Boost logo

Boost-Build :

Subject: [Boost-build] Issues linking C++ program
From: Ryan Gonzalez (rymg19_at_[hidden])
Date: 2015-02-10 14:43:29


I have this Jamroot:

project : requirements
    "<toolset>gcc:<cxxflags>-std=c++11"
    "<toolset>clang:<cxxflags>-std=c++11 -fcolor-diagnostics"
;

lib asmjit : : <link>shared ;
lib rejit : [ glob rejit/*.cpp ] asmjit : <include>. <link>static : :
<include>. ;
exe tst : tst.cpp rejit ;

install bin : rejit tst ;

I guess it should work well...but it DOESN'T. I get this error:

ryan_at_DevPC-LX:~/rejit$ b2
...found 28 targets...
...updating 2 targets...
clang-linux.link bin/clang-linux-3.6.0/debug/tst
/usr/bin/ld: bin/clang-linux-3.6.0/debug/tst.o: undefined reference to
symbol '__cxa_pure_virtual@@CXXABI_1.3'
//usr/lib/x86_64-linux-gnu/libstdc++.so.6: error adding symbols: DSO
missing from command line
clang-3.6: error: linker command failed with exit code 1 (use -v to see
invocation)

    "/media/ryan/stuff/llvm/build/bin/clang-3.6" -o
"bin/clang-linux-3.6.0/debug/tst" -Wl,--start-group
"bin/clang-linux-3.6.0/debug/tst.o"
"bin/clang-linux-3.6.0/debug/link-static/librejit.a" -Wl,-Bstatic
 -Wl,-Bdynamic -lasmjit -Wl,--end-group -g

...failed clang-linux.link bin/clang-linux-3.6.0/debug/tst...
...skipped <pbin>tst for lack of <pbin/clang-linux-3.6.0/debug>tst...
...failed updating 1 target...
...skipped 1 target...
ryan_at_DevPC-LX:~/rejit$

Looks like Boost.Build is using clang to link tst instead of clang++. Why??

-- 
Ryan
If anybody ever asks me why I prefer C++ to C, my answer will be simple:
"It's becauseslejfp23(@#Q*(E*EIdc-SEGFAULT. Wait, I don't think that was
nul-terminated."
Personal reality distortion fields are immune to contradictory evidence. -
srean
Check out my website: http://kirbyfan64.github.io/


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