Subject: Re: [Boost-build] build for mac os x older targets
From: SÃ¸ren (sd_at_[hidden])
Date: 2014-10-03 06:55:20
I solved it!
I browsed the Internet about this and found others with issues caused by
different default C++ libraries across OS X 10.8 and 10.9.
I then builded Boost using:
./b2 toolset=clang link=static runtime-link=static
macosx-version-min=10.8 cxxflags="-std=c++11 -stdlib=libstdc++ -arch
x86_64" linkflags="-stdlib=libstdc++ -arch x86_64" architecture=x86
and included -stdlib=libstdc++ when building my own program. The default
is libc++ which apparently differs in such a way that link compability
Perhaps the relevant maintainers may consider to deal with this in
future boost releases. Either in the documentation and/or in
clang-darwin.jam and darwin.jam.
On 01/10/2014 09:13, SÃ¸ren wrote:
> Hi All
> I have problems building boost static and my app for older versions of
> I'm running Maverick 10.9.x using the clang compiler included in
> Xcode: Apple LLVM version 6.0 (clang-600.0.51) (based on LLVM 3.5svn).
> I'm building boost 1.56 from tar.gz. Static link, only using
> serialization. When I don't worry about the target, it works perfectly
> and runs there successfully on Maverick.
> Then I try to build for the previous version 10.8:
> $ ./b2 link=static threading=multi runtime-link=static
> in validate-value-string from module feature
> error: "10.8" is not a known value of feature <macosx-version-min>
> error: legal values:
> I found a possible fix for that by adding this line to
> feature macosx-version-min : : propagated optional ;
> feature.extend macosx-version-min : 10.8 ; ## <-- added line
> Boost then seemingly builds successfully but I have trouble linking
> from my app:
> clang++ main.cpp -v -o testapp -mmacosx-version-min=10.8
> -I../boost_1_56_0 -L../boost_1_56_0/stage/lib -lboost_serialization
> -demangle -dynamic -arch x86_64 -macosx_version_min 10.8.0 -o testapp
> -lboost_serialization -lstdc++ -lSystem
> Undefined symbols for architecture x86_64:
> char, std::char_traits<char> >::init()", referenced from:
> char, std::char_traits<char> >::init(unsigned int) in main-6804fc.o
> ld: symbol(s) not found for architecture x86_64
> Does anyone know about a fix for this?
> Thanks in advance
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