[C++-sig] Re: Boost::Python for C code -> Segmentation fault

sashan sashang at ihug.co.nz
Wed Jul 28 08:31:42 CEST 2004

> There is no segfault under Red Hat 8 when using these commands:
> g++ -fPIC -O0 -I/net/worm/scratch1/rwgk/dist/boost -I/usr/include/python2.2 -c
> -o segfault.os segfault.cpp
> g++ -shared -o segfault.so segfault.os -Llibtbx -lboost_python -lm

Thanks for that. The following works for me:

g++ -g -I/usr/include/python2.3 -c -osegfault.o segfault.cpp
g++ -shared -osegfault.so segfault.o -lboost_python

whereas if I used ld to do the linking:

ld -shared -osegfault.so segfault.o -lboost_python

a segfault occurs. I don't know why.

More information about the Cplusplus-sig mailing list