我正在用构建应用程序boost.python图书馆。我想把它联系起来。代码如下:
#include <boost/python.hpp>
using namespace boost::python;
// Boost.python definitions to expose classes to Python
BOOST_PYTHON_MODULE(arrayClasses) {
}
并为其生成文件:
^{pr2}$当我编译它时,我得到:
g++ -shared -Wl,--export-dynamic \
arrayClasses.o -L/usr/lib -lboost_python \
-L/usr/lib/python2.7/config -lpython2.7 \
-o arrayClasses.so
/usr/bin/ld: arrayClasses.o: relocation R_X86_64_32 against `init_module_arrayClasses()' can not be used when making a shared object; recompile with -fPIC
arrayClasses.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
怎么了?在
编辑:忽略它。这是在一个32位的Ubuntu系统上用python2.6和boost1.44编译的。正如ignaciovazquez-Abrams所指出的,您可能应该检查一下Python和Boost库是否是为相同的架构编译的。在
相关问题 更多 >
编程相关推荐