Boost python and Mac Mavericks

Boost python and Mac Mavericks

本文关键字:Mavericks Mac and python Boost      更新时间:2023-10-16

我刚刚将我的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 

....页面和类似错误的页面。 有谁知道发生了什么事?

在切换到特立独行之前,你在哪里使用 Xcode 5?

您可以尝试更改项目使用的标准库版本,因为 Xcode 的 LLVM 编译器中的默认值从 C++98 切换到 C++11。

要检查它,请在xcode,"构建设置"选项卡和" Apple LLVM 5.0 - 语言 - C++"中的目标设置中进行更改:

  • C++ 语言方言从"编译器默认"到"GNU++98"
  • C++ 标准库从"编译器默认"到"libstdc++(GNU C++标准库)"