I was following Boost Getting Started on Windows to learn Boost. I linked the example solution to a Boost
library within the Visual Studio IDE the same as 6.1 Link From Within the Visual Studio IDE. After I built the solution, I got the following error:
Error: LNK1104 cannot open file ‘libboost_regex-vc142-mt-gd-x32-1_71.lib’
I got a solution from fatal error LNK1104: cannot open file ‘libboost_system-vc110-mt-gd-1_51.lib’ and it worked well.
The
C++ → General → Additional Include Directories
parameter is for listing directories where the compiler will search for header files. You need to tell the linker where to look for libraries to link to.
- To access this setting, right-click on the project name in the
Solution Explorer
window, thenProperties → Linker → General → Additional Library Directories
.- Enter
<boost_path>\stage\lib
here, e.g.C:\Program Files\boost\boost_1_71_0\stage\lib
(this is the path where the libraries are located if you build Boost using default options).