Boost logo

Boost Users :

From: John Hunter (jdhunter_at_[hidden])
Date: 2002-06-06 08:51:59

Hi David,

I have found out a little bit more about the problem. It only occurs
if I link with the dynamic library generated by bjam in
When I link against the static library, which I built using the
makefile linux_gcc.mak, the segmentation fault no longer occurs. I
replicated the problem with OverloadTest in comprehensive.cpp (seg
fault occurs when calling the first overloaded constructor iff linking
against the shared lib compiled by bjam). Are you linking against the
static or dynamic version of libboost_python?

Below I'll include some relevant lines of my bjam output which I
compiled with debug 2 and some from the make output where I build the
static library. Could any of the flags that bjam sets be causing my
problem if I don't also set them when building my extension module?
bjam is setting -ftemplate-depth-100 -DBOOST_PYTHON_DYNAMIC_LIB -g -O0
-fno-inline -fPIC and I am setting -fPIC and -ftemplate-depth-100.

BTW: I could not find the enclosed user directory you referred to in
your post.

John Hunter

Sample bjam out:
gcc-C++-action libs/python/build/bin/
    g++  -c -Wall -ftemplate-depth-100  -DBOOST_PYTHON_DYNAMIC_LIB  -g -O0 -fno-inline -fPIC   -I"libs/python/build" -I"/usr/local/include/python2.1" -I"/workn/jdhunter/c/lib/boost_1_28_0"   -o "libs/python/build/bin/"  "libs/python/build/../src/errors.cpp" 
gcc-Link-action libs/python/build/bin/
    export LD_LIBRARY_PATH 
    g++   -g -fPIC -shared  -o "libs/python/build/bin/"  -L/usr/local/lib/python2.1/config   "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/" "libs/python/build/bin/"    -lutil  -Wl,-rpath-link,. "-Wl,-soname," 
    ln -fs "" "libs/python/build/bin/" 
Sample make static lib out:
g++   -I/usr/local/include/boost -I/usr/local/include/python2.1 -fPIC -ftemplate-depth-21  -g -c errors.cpp
rm -f libboost_python.a
ar r libboost_python.a classes.o conversions.o errors.o extension_class.o functions.o init_function.o module_builder.o objects.o types.o cross_module.o
>>>>> "David" == David Abrahams <david.abrahams_at_[hidden]> writes:
    David> I can't reproduce your problem with gcc-3.0.4 or gcc-3.1
    David> Unzip the enclosed "user" directory to your libs/python
    David> directory and run bjam there to test it yourself. Works for
    David> me.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at