Boost.Python sans Jam

Mark Hobbes2176 at yahoo.com
Thu Nov 21 23:31:27 EST 2002


Hello all,

I'd like to use the product of Boost.Python (ie libboost_python and the 
necessary header files) without resorting to using jam as my comilation 
system (why?  I want to learn one thing at a time ... right now I'll focus 
on Boost.Python ... when I want to learn jam, I'll look at it).

Basically, I have set up a ~/include and ~/lib directory that have the 
requisite header and library files [note, these only hold the boost and 
boost.python headers and the boost.python libraries].  Everything else is 
in "standard" (insert joke here) or at least system wide locations.

Currently, if I try to compile hello.cpp (that is included in the 
boost.python distro), I get a number of unresolved symbols out of the 
libboost_python library (I did built the library with jam, but now I want 
to go to make ... once the library is built, it shouldn't make a 
difference).

My command line to compile hello.cpp looks like:
g++ hello.cpp -I/home/mfenner/include -I/usr/include/python2.2/ 
-L/usr/lib/python2.2/config -L/home/mfenner/lib -lpython2.2 -lboost_python 
-o hello.so

And I get errors:
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/../../../crt1.o: In function 
`_start':
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2/../../../crt1.o(.text+0x18): 
undefined reference to `main'
/home/mfenner/lib/libboost_python.so: undefined reference to 
`PyErr_BadArgument'
/home/mfenner/lib/libboost_python.so: undefined reference to 
`PySequence_DelSlice'
<snip many, many more similar undefined reference errors>

What am I missing and/or what have I inappropriately included?

Regards,
Mark



More information about the Python-list mailing list