Я пытаюсь построить проект с: https://github.com/TNG/boost-python-examples, который представляет собой набор примеров python для boost на Yosemite.Ссылка на Boost Python на OSX 10.10
Сначала я установил подталкивание и Boost, питона и CMake
brew install boost
brew install boost-pyton
brew install cmake
Я бегите в следующей ошибки:
/usr/local/Cellar/cmake/3.0.2/bin/cmake -H/Users/demo/devel/boost-python-examples -B/Users/demo/devel/boost-python-examples/build --check-build-system CMakeFiles/Makefile.cmake 0
/usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_progress_start /Users/demo/devel/boost-python-examples/build/CMakeFiles /Users/demo/devel/boost-python-examples/build/CMakeFiles/progress.marks
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f CMakeFiles/Makefile2 all
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f 01-HelloWorld/CMakeFiles/hello.dir/build.make 01-HelloWorld/CMakeFiles/hello.dir/depend
cd /Users/demo/devel/boost-python-examples/build && /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_depends "Unix Makefiles" /Users/demo/devel/boost-python-examples /Users/demo/devel/boost-python-examples/01-HelloWorld /Users/demo/devel/boost-python-examples/build /Users/demo/devel/boost-python-examples/build/01-HelloWorld /Users/demo/devel/boost-python-examples/build/01-HelloWorld/CMakeFiles/hello.dir/DependInfo.cmake --color=
/Applications/Xcode.app/Contents/Developer/usr/bin/make -f 01-HelloWorld/CMakeFiles/hello.dir/build.make 01-HelloWorld/CMakeFiles/hello.dir/build
Linking CXX shared module hello.so
cd /Users/demo/devel/boost-python-examples/build/01-HelloWorld && /usr/local/Cellar/cmake/3.0.2/bin/cmake -E cmake_link_script CMakeFiles/hello.dir/link.txt --verbose=1
/usr/bin/c++ -g -bundle -Wl,-headerpad_max_install_names -o hello.so CMakeFiles/hello.dir/hello.cpp.o /usr/local/lib/libboost_python-mt.dylib
Undefined symbols for architecture x86_64:
"_PyString_Type", referenced from:
boost::python::to_python_value<char const* const&>::get_pytype() const in hello.cpp.o
"__Py_NoneStruct", referenced from:
boost::python::api::object::object() in hello.cpp.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [01-HelloWorld/hello.so] Error 1
make[1]: *** [01-HelloWorld/CMakeFiles/hello.dir/all] Error 2
make: *** [all] Error 2
Похоже, его призвание:
/usr/bin/c++ -stdlib=libstdc++ -g -bundle -Wl,-headerpad_max_install_names -o hello.so CMakeFiles/hello.dir/hello.cpp.o /usr/local/lib/libboost_python-mt.dylib
I 'Пробовал следующее:
- Удаление
-stdlib=libstdc++
- Использование
gcc
вместоc++
- Использование
-m32
(плохая идея)
Насколько я могу сказать dynlib хорошо: /usr/local/lib/libboost_python-mt.dylib: Mach-O 64-bit dynamically linked shared library x86_64
Так что я m не уверен, где моя проблема в настоящее время. Я предполагаю, что это какой-то флаг сборки, который я здесь отсутствует.
Спасибо!