boost.numpy编译报错:undefined reference to `PyInt_FromLong' libboost_numpy.so: undefined reference to `PyCObject_AsVoidPtr'


[ 31%] Built target boost_numpy
[ 36%] Building CXX object libs/numpy/example/CMakeFiles/dtype.dir/dtype.cpp.o
Linking CXX executable ../../../bin/dtype
CMakeFiles/dtype.dir/dtype.cpp.o: In function `boost::python::converter::arg_to_python<int>::arg_to_python(int const&)':
dtype.cpp:(.text._ZN5boost6python9converter13arg_to_pythonIiEC2ERKi[_ZN5boost6python9converter13arg_to_pythonIiEC5ERKi]+0x1c): undefined reference to `PyInt_FromLong'
../../../lib/libboost_numpy.so: undefined reference to `PyCObject_AsVoidPtr'
../../../lib/libboost_numpy.so: undefined reference to `PyCObject_Type'
collect2: error: ld returned 1 exit status
make[2]: *** [bin/dtype] Error 1
make[1]: *** [libs/numpy/example/CMakeFiles/dtype.dir/all] Error 2
make: *** [all] Error 2

这个问题的原因我也不知道,但是我是这样解决的:

下载这个版本的boost.numpy:

https://github.com/ndarray/Boost.NumPy/tree/26aaa5b62e6170f2ccde179b46f1a49c4011fc9d


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM