Using boost.python with make instead of bjam

Well, I was obiously stupid. To link one has to put the object BEFORE the library with the symbols. So turning

g++ -shared -Wl,-soname,"libhello.so" -L/usr/local/lib -lboost_python -fpic -o libhello.so hello.o

into

g++ -shared -Wl,-soname,"libhello.so" -L/usr/local/lib hello.o -lboost_python -fpic -o libhello.so

Gave me the expected result, after I recompiled boost.python with cxxflags=-fPIC.


You could try something like this:

 g++  -I/usr/include/python2.4 -fpic  hello.cpp -shared -lboost_python -o libhello.so