Error LNK1104 cannot open file 'libboost_filesystem-vc141-mt-gd-1_65_1.lib'
Solution 1
Make sure you add the "<location of boost installation directory, where ever it was extracted>\stage\lib" to the linker library include path in the Visual Studio Debug Properties for the project. If you install boost via the Command Prompt by first running the bootstap.bat batch file followed by b2.exe , when the compiling process is complete, a message will be displayed instructing you to add that path, so the linker doesn't get confused when it looks for it.
Solution 2
the most common causes of this error are:
1- Architecture. The .lib is x64 and the build is 32 bits or viceversa (.libs are 32 and build is x64).
2- Path to the files. Check the boost path is the same. If you are using the precompiled libraries the path is similar to .....\boost_1_65_1\lib64-msvc-14.1 But if you have compiled, it will be like stage\lib. Search for it in the explorer and cut and paste the path.
Regards
Related videos on Youtube
Adam
Updated on June 04, 2022Comments
-
Adam almost 2 years
I cannot seem to solve this issue. I would like to use boost but continue to get the error LNK1104 cannot open file 'libboost_filesystem-vs141-mt-gd-1_65_1.lib'. I have followed the steps i.e: 1. Running the bat 2. Running the b2 (originally bjam) 3. Linked the files. After receiving the error I did digging and have changed a few other things. See images below for a better understanding of what I have completed.
I appreciate all answers in the future, and thank you for taking the time.
-
tkausl over 6 yearsDoes this file exist in your boost\stage\lib folder?
-
Joe over 6 yearsTake a look at the "command line" category of those settings. There you will see every single library include folder that your link references. Verify that the library is in one of them
-
Adam over 6 years@tkausl The file does exist in the folder.
-
Adam over 6 years@Joe Also the command line category shows the following "/ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"C:\Users\skudt\source\boost_1_65_1\stage\lib" /TLBID:1"
-
Joe over 6 yearsOK, well then the lib you're looking for must not be there (in c:\users\skudt\source\boost_1_64\stage\lib) because the linker isn't finding it. And it's not being found anywhere else. Next step is to change the linker settings to be as verbose as possible. This will show you (if you have the patience to read it all) every single path the linker searches for link libraries.
-
-
Nguyễn Đức Tâm over 4 yearsThe boost-binaries are the full library after you run the b2.exe right?