我刚刚将我的 Mac OS 更新为 Maverick,它似乎损坏了某些东西!
我正在编写 C++ 代码并使用 boost.python 编写 Python 前端。升级前我有工作代码,升级后我开始收到一个奇怪的链接错误:
darwin.link.dll /Users/Andy/software/boost-1.54.0/bin.v2/libs/python/build/darwin-4.8.1/debug/libboost_python.dylib
Undefined symbols for architecture x86_64:
"std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::size() const", referenced from:
boost::python::converter::(anonymous namespace)::wstring_rvalue_from_python::extract(_object*) in builtin_converters.o
"std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::empty() const", referenced from:
boost::python::converter::(anonymous namespace)::wstring_rvalue_from_python::extract(_object*) in builtin_converters.o
"std::basic_string<char, std::char_traits<char>, std::allocator<char> >::data() const", referenced from:
boost::python::converter::arg_to_python<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >::arg_to_python(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) in numeric.o
.... 页面和类似错误的页面。有谁知道发生了什么事吗?
最佳答案
在切换到 Mavericks 之前,您在哪里使用 Xcode 5?
您可以尝试将项目使用的标准库版本更改为 Xcode 的 LLVM 编译器中的默认版本,从 C++98 切换到 C++11。
要检查它,请进入 xcode 中的目标设置,“build设置”选项卡和“Apple LLVM 5.0 - 语言 - C++”更改:
- 从“编译器默认”到“GNU++98”的 C++ 语言方言
- C++ 标准库从“编译器默认”到“libstdc++(GNU C++ 标准库)”
关于c++ - Boost python 和 Mac Mavericks,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19635240/