Boost logo

Boost-Build :

From: Daniel Schlyder (daniel_at_[hidden])
Date: 2005-09-18 18:40:57


Hi Volodya,

> The docs are wrong ;-) The <source> feature is identical to putting something
> to the list of sources. The <library> feature is almost the same, but only for
> linking. So, <library> feature on a target that does no linking is ignored.

I see. Thanks for the explanation.

>> and that I should use the former, but executables in one of
>> my projects segfaults if I don't use the latter to link Boost.Filesystem.
>>
>> (Using Boost CVS HEAD, MinGW GCC 3.4.4, BJam 03.01.11.)

> Wierd. Can you compare the link lines. The only reason I can think of is that
> in one of the cases you don't link to boost.filesystem at all, and mingw for
> some reason don't report unresolved symbols.

Here are the link lines if I use <source>:

gcc.link bb-bin\dasc\lib\base\example\gcc\debug\link-static\threading-multi\system-paths-d.exe

"g++" -Wl,-R
-Wl,"E:\projects\libdasc\wc2\bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi"
-Wl,-rpath-link
-Wl,"E:\projects\libdasc\wc2\bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi"
-o
"bb-bin\dasc\lib\base\example\gcc\debug\link-static\threading-multi\system-paths-d.exe"
"bb-bin\dasc\lib\base\example\gcc\debug\link-static\threading-multi\system_paths.o"
"bb-bin\boost\bin.v2\libs\log\build\gcc\debug\link-static\threading-multi\boost_log-gcc-mt-d-1_33.a"
"bb-bin\boost\bin.v2\libs\filesystem\build\gcc\debug\link-static\threading-multi\boost_filesystem-gcc-mt-d-1_33.a"
"bb-bin\boost\bin.v2\libs\date_time\build\gcc\debug\link-static\threading-multi\boost_date_time-gcc-mt-d-1_33.a"
"bb-bin\nvwa\gcc\debug\link-static\threading-multi\debug_new.a"
"bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi\boost_thread-gcc-mt-d-1_33.dll"
"bb-bin\dasc\lib\base\gcc\debug\link-static\threading-multi\dasc_base.a"
"bb-bin\boost\bin.v2\libs\log\build\gcc\debug\link-static\threading-multi\boost_log-gcc-mt-d-1_33.a"
"bb-bin\boost\bin.v2\libs\filesystem\build\gcc\debug\link-static\threading-multi\boost_filesystem-gcc-mt-d-1_33.a"
"bb-bin\boost\bin.v2\libs\date_time\build\gcc\debug\link-static\threading-multi\boost_date_time-gcc-mt-d-1_33.a"
"bb-bin\nvwa\gcc\debug\link-static\threading-multi\debug_new.a"
"bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi\boost_thread-gcc-mt-d-1_33.dll"
-g -mthreads

and here are the lines when I use <library> (for all libraries, although I
only need to use it to link Boost.Filesystem to make the segfaults go away):

gcc.link bb-bin\dasc\lib\base\example\gcc\debug\link-static\threading-multi\system-paths-d.exe

"g++" -Wl,-R
-Wl,"E:\projects\libdasc\wc2\bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi"
-Wl,-rpath-link
-Wl,"E:\projects\libdasc\wc2\bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi"
-o
"bb-bin\dasc\lib\base\example\gcc\debug\link-static\threading-multi\system-paths-d.exe"
"bb-bin\dasc\lib\base\example\gcc\debug\link-static\threading-multi\system_paths.o"
"bb-bin\dasc\lib\base\gcc\debug\link-static\threading-multi\dasc_base.a"
"bb-bin\boost\bin.v2\libs\log\build\gcc\debug\link-static\threading-multi\boost_log-gcc-mt-d-1_33.a"
"bb-bin\boost\bin.v2\libs\filesystem\build\gcc\debug\link-static\threading-multi\boost_filesystem-gcc-mt-d-1_33.a"
"bb-bin\boost\bin.v2\libs\date_time\build\gcc\debug\link-static\threading-multi\boost_date_time-gcc-mt-d-1_33.a"
"bb-bin\nvwa\gcc\debug\link-static\threading-multi\debug_new.a"
"bb-bin\boost\bin.v2\libs\thread\build\gcc\debug\threading-multi\boost_thread-gcc-mt-d-1_33.dll"
-g -mthreads

It seems the difference is that the libraries are linked twice when using
<source>. Could this explain the segfaults? (I'm sorry, I don't have much
debugging experience.)

Thanks,

--
Daniel Schlyder
http://bitblaze.com/
 

Boost-Build list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk