On Mon, Jun 26, 2017 at 12:55:21PM -0700, Robert Ramey wrote:
On 6/26/17 12:36 PM, Pavol Juhas via Boost-users wrote: ...
# -------------------------------------------------------------- $ export MACOSX_DEPLOYMENT_TARGET=10.7 $ ./bootstrap.sh $ ./b2 -j4 variant=release link=shared --with-serialization stage
$ c++ tarchive.cpp -I. -Lstage/lib -lboost_serialization Undefined symbols for architecture x86_64: ... # -------------------------------------------------------------- ... The only thing the test program (attached) does is to instantiate the boost::archive::binary_oarchive class. The procedure above works fine when MACOSX_DEPLOYMENT_TARGET is set to 10.9 or higher. ...
I'm sorry I can't help much. I do you mac os. I build and test the serialization library with xcode project generated by CMake. The xcode (and by extension Clang C++) has a huge number of options any one of which could be the reason that one can't link two modules. Note that I also test with the bjam command line which also has access to compile/link time switches. I test this with both gcc and clang
I would suggest:
a) Make sure you can build/test without the MACOSX_DEPLOYMENT_TARGET=10.7 setting. If this is indeed the problem you this would help you know.
Thank you Robert for a quick response. I have indeed tried different values for MACOSX_DEPLOYMENT_TARGET. The serialization library and the test program compiled and ran OK when deployment target was set to 10.9, 10.10 and when left unset. Presumably when MACOSX_DEPLOYMENT_TARGET is not present xcode builds for the current OS X version, which is 10.10 in my case. The link step fails when MACOSX_DEPLOYMENT_TARGET is 10.7 or 10.8.
b) try b2 build and try CMake build Once you get one of these to work, add in the MACOSX_DEPLOYMENT_TARGET and try again.
Would you have a pointer on how to build boost serialization with CMake? I was not able to quickly find such instructions at the boost page or in serialization repository. Perhaps CMake has different rules than bjam on setting compiler options when MACOSX_DEPLOYMENT_TARGET is in the environment. Thank you, Pavol