For a client I needed to add boost 1.54 to the system. So I downloaded the latest version (1.55) and built it within a special directory: /usr/local/lib/boost1.55/. This works. Then I had to adapt the Makefile in this way.
LIBS = $(SUBLIBS) -L/usr/lib/x86_64-linux-gnu -LC:/deps/miniupnpc -lminiupnpc -lqrencode -lrt -LC:/deps/boost/stage/lib -Lc:/deps/db/build_unix -Lc:/deps/ssl -LC:/deps/libqrencode/.libs -lssl -lcrypto -ldb_cxx -L/usr/local/lib/boost1.55/boost_system-mgw46-mt-sd-1_54 -L/usr/local/lib/boost1.55/boost_filesystem-mgw46-mt-sd-1_54 -L/usr/local/lib/boost1.55/boost_program_options-mgw46-mt-sd-1_54 -L/usr/local/lib/boost1.55/boost_thread-mgw46-mt-sd-1_54 -lQtDBus -lQtGui -lQtCore -lpthread -lboost_system -lboost_filesystem -lboost_program_options -lboost_thread
In the unmodified Makefile, the boost linkings looked like this:
-lboost_thread-mgw46-mt-sd-1_54
But this didn't work. I wasn't able to compile it because it was not found. So I added (as you can see above)
-L/usr/local/lib/boost1.55/boost_thread-mgw46-mt-sd-1_54
and
-lboost_thread
Otherwise it wouldn't compile either. After successful compilation, I executed ldd on the binary and it shows me:
libboost_system.so.1.53.0 => /usr/lib/x86_64-linux-gnu/libboost_system.so.1.53.0 (0x00007f416c169000) libboost_filesystem.so.1.53.0 => /usr/lib/x86_64-linux-gnu/libboost_filesystem.so.1.53.0 (0x00007f416bf52000) libboost_program_options.so.1.53.0 => /usr/lib/x86_64-linux-gnu/libboost_program_options.so.1.53.0 (0x00007f416bce4000) libboost_thread.so.1.53.0 => /usr/lib/x86_64-linux-gnu/libboost_thread.so.1.53.0 (0x00007f416bace000)
1.53 is the version installed by package manager. I don't understand why it links to this version. If I wouldn't have installed 1.55, it would not compiled, but now it doesn't link to this version. Any explanation for that?
Actually my target is to not use dynamic linked libraries and I didn't figured out yet how to do that, but I still want to know why the above doesn't work as expected.