Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to specify linker dependencies in boost.build Jamroot
    primarykey
    data
    text
    <p>When I try to compile an exec with <code>b2 toolset=clang</code> it uses a linking command like :</p> <pre><code>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/date_time/build/clang-linux-3.3/release/link-static/libboost_date_time.a ~/infra_install/lib/libfixfast.a ~/infra_install/lib/libCDef.a -lbz2 -lz -lpthread </code></pre> <p>and fails with a long list of undefined references in boost, whereas the following reordered version of it links fine :</p> <pre><code>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/libfixfast.a ~/infra_install/lib/libCDef.a /apps/boost/root/bin.v2/libs/date_time/build/clang-linux-3.3/release/link-static/libboost_date_time.a -lbz2 -lz -lpthread </code></pre> <p>I believe the way I am specifying linking dependency of <code>libCDef</code> on <code>/boost/date_time//boost_date_time</code> is probably not enough to have the right order during linking.</p> <p>CDef/Jamroot :</p> <pre><code>project : usage-requirements &lt;include&gt;~/infra_install ; lib CDef : [ glob *.cpp ] : &lt;library&gt;/boost/date_time//boost_date_time &lt;library&gt;/boost/filesystem//boost_filesystem &lt;library&gt;/boost/system//boost_system &lt;library&gt;/boost/iostreams//boost_iostreams &lt;link&gt;static ; install libCDef : CDef : &lt;install-type&gt;LIB &lt;variant&gt;release:&lt;location&gt;"~/infra_install/lib" : release ; </code></pre> <p>I need to specify that CDef depends on boost_date_time and hence the linker should order it as such.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload