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

Ralf W. Grosse-Kunstleve rwgk at yahoo.com
Wed Jul 28 10:39:43 CEST 2004


--- sashan <sashang at ihug.co.nz> wrote:

> > 
> > 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.

Probably because the g++ front-end implicitly adds different runtime libraries.
Ralf



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 



More information about the Cplusplus-sig mailing list