Adam
Adam

Reputation: 97

Error LNK1104 cannot open file 'libboost_filesystem-vc141-mt-gd-1_65_1.lib'

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 completedThis is the VC++ where I added the boost_path.This is the linker

I appreciate all answers in the future, and thank you for taking the time.

Upvotes: 3

Views: 19706

Answers (4)

James Reboulet
James Reboulet

Reputation: 46

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.

Upvotes: 3

Csuszmusz
Csuszmusz

Reputation: 335

Its because the configured platform toolset differs from the library that you want to use. You can set it easily in visual studio '19 under the following setting: Configuration Properties -> General -> Platform Toolset and select the one you want to use.

e.g.: PlatformToolset

Upvotes: 0

Kokeb
Kokeb

Reputation: 437

I was getting similar errors after installing the pre-build boost using boost_1_67_0-msvc-14.0-64.exe (downloaded from https://sourceforge.net/projects/boost/files/boost-binaries/1.67.0/). It turns out that pre-build (14.0) has lib naming issues like referencing files with names containing the string "-vc141-" in them instead of "-vc140-".

I abandoned that and used the installer boost_1_67_0-msvc-14.1-64.exe (note the msvc14.1). All the issues I was seeing are gone now.

Upvotes: 0

Proxenus
Proxenus

Reputation: 31

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

Upvotes: 3

Related Questions