You are not logged in.

#1 2011-02-01 16:00:40

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

boost python problem...

$ cat a.C
int main() {}

$ g++ -lboost_python a.C
[...]
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `_PyType_Lookup'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyList_New'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyType_GenericAlloc'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyMem_Malloc'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyCallable_Check'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyDict_Clear'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PySequence_SetSlice'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyLong_AsUnsignedLong'
/usr/lib/gcc/x86_64-unknown-linux-gnu/4.5.2/../../../../lib/libboost_python.so: undefined reference to `PyDict_New'
collect2: ld returned 1 exit status

$

What can I try? I already reinstalled boost and boost-libs...

Offline

#2 2011-02-01 18:05:15

falconindy
Developer
From: New York, USA
Registered: 2009-10-22
Posts: 4,111
Website

Re: boost python problem...

You're missing a linker flag for python, -lpython2.7 perhaps? It's not directly related to boost.

Offline

#3 2011-02-01 21:44:31

ezzetabi
Member
Registered: 2006-08-27
Posts: 947

Re: boost python problem...

Thanks. That was the problem.

Offline

Board footer

Powered by FluxBB