啊! 我遇到了其中一个我真的一无所知的错误。我已经构建/安装了 Python (2.7.1),并且针对该版本的 python 构建/安装了 boost (1.44.0)。我在我的 boost 构建中没有看到任何错误,一切正常。
当我开始构建具有很多 boost 依赖项的应用程序时,在我的 C++ 代码中,我确实调用了 Py_Init(...) 我收到以下错误:
Linking CXX executable ../../../myapp_exec
../../../../../config/cmake/platforms/../../../../3rdparty/2012/<pack>/rh5_x86_64_gcc-4.1.2/boost-1.44.0/lib/libboost_python-gcc41-1_44.so: undefined reference to `Py_InitModule4' collect2: ld returned 1 exit status
gmake[2]: *** [myapp_exec] Error 1
我四处搜索,但没有什么真正作为解决方案出现。我在 Windows 上没有看到这个问题。感谢是否有人可以分享他们在 Linux (RHEL5) 上遇到类似问题的经验,以及他们是如何克服它的。我可以尝试针对旧版本的 Python(2.6.4 或更早版本)构建 boost-1.44.0。
提前感谢您的时间和兴趣。-T。