[C++-sig] Building boost::python on Ubuntu - now linking problem
Simon Pickles
sipickles at hotmail.com
Tue Jan 8 08:58:25 CET 2008
Yes, sorry, good point!
Strangely, boost::python was very simple to set up on my home ubuntu box
last night.
At work (identical os), I still have the problem as soon as I include
<boost/python.hpp>. Its like I have not linked to the python API, but
from my command line below, you can see I have.
Heres is my extensive program:
#include <boost/python.hpp>
int main()
{
return 0;
}
Here is my output, embeddedTest is simply the name of my project :
*-------------- Build: Debug in embeddedTest ---------------*
g++ -L/usr/local/boost_1_34_1/stage/lib -o bin/Debug/embeddedTest
obj/Debug/main.o -lpthread -lpython2.5
obj/Debug/main.o: In function `_object*
boost::python::incref<_object>(_object*)':
/usr/local/boost_1_34_1/boost/python/refcount.hpp:16: undefined
reference to `_Py_RefTotal'
/usr/local/boost_1_34_1/boost/python/refcount.hpp:16: undefined
reference to `_Py_RefTotal'
obj/Debug/main.o: In function `~object_base':
/usr/local/boost_1_34_1/boost/python/object_core.hpp:436: undefined
reference to `_Py_RefTotal'
/usr/local/boost_1_34_1/boost/python/object_core.hpp:436: undefined
reference to `_Py_RefTotal'
/usr/local/boost_1_34_1/boost/python/object_core.hpp:436: undefined
reference to `_Py_NegativeRefcount'
/usr/local/boost_1_34_1/boost/python/object_core.hpp:436: undefined
reference to `_Py_Dealloc'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 1 seconds)
6 errors, 0 warnings
Thanks for your advice.
Simon
Stefan Seefeld wrote:
> Simon Pickles wrote:
>
>> I thought so, and already have -lpython2.5 in my linker command line,
>> along with -lpthread.
>>
>> But still this problem :(
>>
>
> Sorry, nobody will be able to help you without more information. Please
> include at least the full command you used for the link. Ideally a
> complete and minimal test case so others can (attempt to) reproduce the
> failure.
>
> Thanks,
> Stefan
>
>
>
--
Linux Counter: User# 424693
More information about the Cplusplus-sig
mailing list