I'm trying to migrate a project written in VS2012 to VS2013.
I successfully compiled boost 1.53.0 (I first tried 1.54.0, but got some compiler errors) and got libraries like
libboost_filesystem-vc120-mt-1_53.lib
.
But when trying to build my project, the linker complains:
error LNK1104: cannot open file 'libboost_filesystem-vc110-mt-1_53.lib'
I've been looking for some project settings in my entire solution to find out, why it's trying to load the older library version, but I didn't find anything.
How does the linker know, which library to use? And how can I fix my problem?
You can check version. hpp inside Boost include dir (normally /usr/include/boost , you can use locate /boost/version. hpp or similar to get that) for BOOST_VERSION or BOOST_LIB_VERSION .
Many of the Boost libraries are actively maintained and improved, so backward compatibility with prior version isn't always possible. Deal with this by freezing the version of the Boost libraries used by your project. Only upgrade at points in your project's life cycle where a bit of change will not cause problems.
6.1 Link From Within the Visual Studio IDEIn Configuration Properties > Linker > Additional Library Directories, enter the path to the Boost binaries, e.g. C:\Program Files\boost\boost_1_55_0\lib\. From the Build menu, select Build Solution.
Boost is a set of libraries for the C++ programming language that provides support for tasks and structures such as linear algebra, pseudorandom number generation, multithreading, image processing, regular expressions, and unit testing. It contains 164 individual libraries (as of version 1.76).
I found the answer to my question and the solution to my problem in TheArtTrooper's answer to this thread:
How do I build boost with new Visual Studio 2013 preview?
The linker does know which library to use, because it is specified in boost/config/auto_link.hpp.
This file is missing a few lines of code to handle the vc120 version:
# elif defined(BOOST_MSVC) && (BOOST_MSVC < 1800)
// vc11:
# define BOOST_LIB_TOOLSET "vc110"
# elif defined(BOOST_MSVC)
// vc12:
# define BOOST_LIB_TOOLSET "vc120"
Now it compiles and links just fine!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With