# Compile Errors when Using the or-tools C++ Library in an SPM Package

**URL:** <https://forums.swift.org/t/compile-errors-when-using-the-or-tools-c-library-in-an-spm-package/75764>\
**Category:** Using Swift\
**Tags:** packagemanager, error, cxx, xcframework, cxx-interop\
**Created:** [November 2, 2024, 2:53am UTC](https://forums.swift.org/t/compile-errors-when-using-the-or-tools-c-library-in-an-spm-package/75764 "2024-11-02T02:53:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SublimeAbode](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/sublimeabode/32/38009_2.png) [@SublimeAbode](https://forums.swift.org/u/SublimeAbode)\
**Post date:** [November 2, 2024, 2:53am UTC](https://forums.swift.org/t/compile-errors-when-using-the-or-tools-c-library-in-an-spm-package/75764/1 "2024-11-02T02:53:26Z")

</div>

Hello, I've been trying to use the or-tools C++ library in an SPM package but to no avail. My current strategy involves wrapping the built or-tools dylib into an xcframework, and then adding it as a binary target into my Swift package. Unfortunately, I end up with a ton of "no member named \_ in namespace \_" errors when trying to build the package. I tried doing the same thing with my own sample C++ library and it worked just fine, so I'm pretty sure it isn't a configuration issue.

Currently I'm only including one header in the clang module map, and invoking only one function in my program. Using the same build files, I run into no issues when invoking said function in a normal C++ project using CMake, so it seems that the problem is something specific to SPM or XCode.

Any ideas? I'd greatly appreciate any help, thanks in advance.

[Link to the or-tools library](https://github.com/SublimeAbode/or-tools)

[Link to the SPM package with build instructions](https://github.com/SublimeAbode/ORTest)

[Output log with build errors](https://gist.github.com/SublimeAbode/c35cd58dd3a0a254639a961a9e4104a6)
