LNK1104 cannot open file 'libboost_regex-vc142-mt-gd-x32-1_71.lib'

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.

  1. To access this setting, right-click on the project name in the Solution Explorer window, then Properties → Linker → General → Additional Library Directories.
  2. 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).
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章