Boost logo

Boost-Build :

From: Andre Hentz (gclbb-jamboost_at_[hidden])
Date: 2003-03-27 04:22:41

Here's another problem related to Cygwin. I have a little project that
builds a static library 'a-static' and a shared library 'b-shared';
'b-shared' is to be linked against 'a-static'. The build fails with:

b-shared/bin/gcc/debug/main.o(.text+0x7): In function
/home/AndreH~1/build/tools/testcase1/b-shared/main.cpp:6: undefined
reference to `printString()'
collect2: ld returned 1 exit status

g++ -g -o b-shared/bin/gcc/debug/b-shared.dll
-Wl,-soname,b-shared.dll -shared b-shared/bin/gcc/debug/main.o
-Wl,-Bdynamic -Wl,-Bstatic -Wl,-Bdynamic -Wl,-Bstatic

It looks like cygwin's gcc is unable to create a shared library if some
symbols are undefined (freebsd's gcc does it with no warnings). In any
case, my intention was to get 'a-static' linked into 'b-shared' by saying:

lib b-shared : main.cpp
: <link>shared

I changed line 53 of gcc.jam from

: OBJ : SHARED_LIB : <toolset>gcc ;


: STATIC_LIB OBJ : SHARED_LIB : <toolset>gcc ;

in order to get the behavior I expected. Is this a bug in gcc.jam?

Best regards,

Andre Hentz


Boost-Build list run by bdawes at, david.abrahams at, gregod at, cpdaniel at, john at