Boost logo

Boost-Build :

Subject: [Boost-build] Question on specifying linker dependencies
From: Gaurav Chakravorty (gchak_at_[hidden])
Date: 2013-05-05 06:46:10


I am not sure if this is the list meant for such questions but here goes.

I am trying to compile a project where there are libraries and execs.
One of the libraries built by the project "libUtils.a" needs to be linked
against boost iostreams

When compiling with toolset gcc it uses a linking command with start-group
and end-group, but when compiling with toolset clang b2 uses a linking
command like :

"clang++" -L"/apps/bzip2/lib" -L"/apps/zlib/lib" -o
"fixfast/bin/clang-linux-3.3/release/link-static/fixfast-mds_MCAST"
"fixfast/bin/clang-linux-3.3/release/link-static/fixfastDataD.o"
 "/apps/boost/root/bin.v2/libs/iostreams/build/clang-linux-3.3/release/link-static/libboost_iostreams.a"
~/infra_install/lib/libCDef.a -lbz2 -lz -lpthread

This produces linking errors like undefined references in boost

When I reorder it to

"clang++" -L"/apps/bzip2/lib" -L"/apps/zlib/lib" -o
"fixfast/bin/clang-linux-3.3/release/link-static/fixfast-mds_MCAST"
"fixfast/bin/clang-linux-3.3/release/link-static/fixfastDataD.o" *
~/infra_install/lib/libCDef.a* *
"/apps/boost/root/bin.v2/libs/iostreams/build/clang-linux-3.3/release/link-static/libboost_iostreams.a"
* -lbz2 -lz -lpthread
 i.e bring boost lib to the end it links fine.

What am I doing wrong ? Any pointers ?

Gaurav Chakravorty
Circulum Vite LLC
2500 PLAZA 5 . Harborside Financial Center, Jersey City, NJ 07311-4026
Tel: 201-377-2302 Fax: 201-604-5422 Cell: 201-500-7416

This communication and any attachments may be privileged or
confidential. Copying
or forwarding without permission of sender is prohibited. If you are
not the intended recipient, you have received this in error and any review,
distribution or copying of this communication is strictly prohibited. In
such an event, please notify us immediately by reply email or by phone
(+1-201-377-2302) and immediately delete this message and all
attachments. E-mail
transmission cannot be guaranteed to be secure or error-free as
information could
be intercepted, corrupted, lost, destroyed, arrive late or incomplete, or
contain viruses. The sender therefore does not accept liability for any
errors or omissions in the contents of this message, which arise as a
result of e-mail transmission. The authenticity of the sender cannot be
claimed in any litigation.



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