0

I am working at building Boost 1.53.0 with Boost Log 2.0r862 on Mac OSX 10.8.2 and installed it to a fake root to keep the /usr/lib* and /opt/lib* clean. I built and installed Boost with
./bootstrap --prefix=/path/to/myfakerootdir
and installed the library with
./b2 install

This built and installed successfully; when running cmake on my project it properly detects the library include and lib directory. Yet after it completes building and attempts to run the executable I get

dyld: Library not loaded: libboost_system.dylib Referenced from: /Users/brad/dev/strata/strataextract/build/Debug/StrataExtractUnitTests Reason: image not found

Some the possible issues I've researched include:
1.Using otool to change the executable manually (Though it seems like a very "hacky" solution)
2.Use a modified portfile at Github Macports Overlay (Though the current version offered is too old for my project.
3.Multiple build tutorials on Boost, unfortunately most referencing Bjam which from what I understand is no longer good practice.
I seem to remember of a similar situation requiring me to set relative path to false, but I am unsure how I would do this with Boost + bjam.

brad_c6
  • 23
  • 1
  • 6
  • You're linking boost dynamically - is it intentional? Does `libboost_system.dylib` exist and where? – Igor R. May 13 '13 at 07:44
  • Yes it exists in /path/to/myfakerootdir/lib/ – brad_c6 May 13 '13 at 08:28
  • I have found that if I copy the dylib in the same directory as teh executable it works. Though the macports copy of Boost (without log) somehow sets the dylib path statically (which is what I would like it to do automatically) – brad_c6 May 13 '13 at 18:18
  • Does the following help? http://www.boost.org/doc/libs/1_53_0/more/getting_started/unix-variants.html#select-a-build-directory – Igor R. May 13 '13 at 18:26
  • I read through it and I got the libraries built, it seems that the best solution maybe if I could somehow get boost from macports and build Boost log from macports – brad_c6 May 13 '13 at 20:07
  • I have gotten much closer by adding the #define BOOST_LOG_DYN_LINK the only error I get is libboost_log.so: undefined reference to `boost::filesystem::detail::copy_file(boost::filesystem::path const&, boost::filesystem::path const&, boost::filesystem::copy_option::enum_type, boost::system::error_code*)' – brad_c6 May 19 '13 at 04:23

0 Answers0