I have already read a lot of post, but I cannot understand how to compile boost library on OS X 10.9.4 in order to link it statically in my application.
I have Xcode 5 installed and also "Command Line Tools" installed.
I have download the ZIP archive of boost 1.56.0, bootstrapped with:
./bootstrap.sh --prefix=/Users/foo/dev/lib/boost_1_56_0 --libdir=/Users/foo/dev/lib/boost_1_56_0/lib
Then installed with
./b2
But when I tried to compile a little test like the following:
#include <boost/log/trivial.hpp>
int main(int, char*[])
{
BOOST_LOG_TRIVIAL(trace) << "A trace severity message";
return 0;
}
With:
clang logtest.cpp -I /Users/foo/lib/boost_1_56_0/include -L /Users/foo/lib/boost_1_56_0/lib
I got a lot of errors regarding the linking:
Undefined symbols for architecture x86_64:
"boost::log::v2s_mt_posix::record_view::public_data::destroy(boost::log::v2s_mt_posix::record_view::public_data const*)", referenced from:
boost::log::v2s_mt_posix::record::reset() in logtest-d5345b.o
...
So I also tried to add the following parameters in the bootstrap:
cxxflags="-arch i386 -arch x86_64" address-model=32_64 threading=multi macos-version=10.9 stage
And the following to b2:
threading=multi link=static runtime-link=static cxxflags="-stdlib=libc++" linkflags="-stdlib=libc++"
But nothing changed...
So I'm looking for a guide that teach how I can compile from scratch the boost library and how I can compile an application that links it.