Error Help: LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc141-mt-gd-1_56.lib'

Hi everyone,

I'm trying to run sample code for a 2D LIDAR sensor using visual studio 2019 and I receive the following error message when I try to build the project:

1>------ Build started: Project: senior_project, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'libboost_thread-vc141-mt-gd-1_56.lib'
1>Done building project "senior_project.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I already linked the include and library folders that came with the SDK for the sensor. Most other people who have posted about a similar issue were able to resolve it by downloading the appropriate boost library. I downloaded and installed boost_1_56_0 but the file isn't located anywhere in there.

Is it possible that I installed the boost library incorrectly or is there something else I need to do?

Thanks!

Last edited on
did you get a pre-compiled boost? You may need to compile boost itself... which should generate the libs you need. be *sure* to compile this in release; you don't need to debug boost's code and will want the higher speed.

you may also be able to find stable and recent pre-compiled boost for windows, but I have not looked lately. Its often out there in the wild.
I believe I compiled it using the bjam application.

Sorry for my lack of understanding but what do you mean compile in release?

Thanks.

EDIT: After looking a bit more, I found a library file called 'libboost_thread-vc-mt-gd-1_56.lib' rather than 'libboost_thread-vc141-mt-gd-1_56.lib'. Could this be the file I need with a different name?
Last edited on
i guess must be DIY complile by use of bjam/other script on the thread dir. among other 95 dirs in libs folder of https://www.boost.org/users/history/version_1_70_0.html package
Last edited on
FYI, Boost version is now version 1.72.0, not 1.70.0. Having a recent older version is not a problem, though.

using visual studio 2019

You built Boost using toolset vc141. That is Visual Studio 2017's tool set. 2019 is vc142.
https://boostorg.github.io/build/manual/master/index.html#bbv2.reference.tools.compilers
(Scroll down for the msvc compiler versions)

This "mismatch" of tool set versions may, or may not, be part of your problem. But why take changes? I wouldn't.

I have both VS 2017 and 2019 installed. I build Boost for each VS version using a custom bootstrap and b2 command, so I get correct lib files for each. I build libs for both x86 and x64 compilation, as well as debug and release versions of the libraries.

If I had only one VS installed I'd still use a custom bootstrap and b2 command so I get it setup the way I want.

To build Boost I open a VS Developer Command Prompt for the VS version I am building Boost for.

Navigate to the Boost root dir. On my system that is: D:\Programming\boost_1_72_0

I bootstrap Boost Build for whatever VS version I am building: bootstrap vc141 or bootstrap vc142

The invocation of b2 is the key to having multiple VS version libs built:
b2 --stagedir=lib\vc141 -a or
b2 --stagedir=lib\vc142 -a

That builds the lib and object (obj) files, putting the lib files in Boost Root\lib\(VS version)\lib directory, creating them if needed. The obj files are in multiple directories under Boost Root\bin.v2

Building the lib and obj files, debug and release, can take a loooooooooong time. Find something else to do other than staring at the monitor. There are more than a few warnings that pop up that DON'T appear to matter in building the libs, so not watching the process is less stress. :)

When the process is complete there is a note to tell you to add a couple of directories to your project properties (example):

The following directory should be added to compiler include paths:

D:\Programming\boost_1_72_0

The following directory should be added to linker library paths:

D:\Programming\boost_1_72_0\lib\vc142\lib


Now, you are using a single VS, 2019, so I would recommend using the following:
bootstrap vc142
followed by b2 -a

That will put your lib files in Boost Root\stage\lib

Whew! I know, long winded, but I hope this helps you with building and using Boost. :)

Yes, building Boost this way takes up a lot of HD space. Both the obj and lib directories/files on my system after building come in at around 10 GB of space.

If you ever want to rebuild Boost from scratch you can delete the obj and lib directories. Then bootstrap and b2 to recreate the files.

Oh, I forgot to mention.....

When adding the include and linker library paths in the project property settings set the Configuration to "All Platforms" and the Platform to "All Platforms" instead of the currently active configuration and platform happen to be.

Do this and no matter how you choose to build a project, debug or release - x86 or x64, VS can find the appropriate Boost files to build.

After setting the include and linker library path I recommend changing back to the current active configuration and platform option, though keeping the options at all configurations and platforms shouldn't cause problems.
Last edited on
Hello Furry Guy,

Thank you so much for the help, the issue makes more sense now! The error has disappeared.

I do now have an issue with library files from the SDK for the sensor. It is the same error with just a different library file.
"LINK : fatal error LNK1104: cannot open file 'librpos_core-vc141-mt-gd-2.6.lib'"

After looking at their product documents, I noticed that it was developed for vs 2010. Is it possible to update these to be compatible with VS 2019?

Slamware Product Documents: https://www.slamtec.com/en/Support
Last edited on
you have to recompile them or get a new copy from the vendor (meaning whoever compiles and puts it out even if free). Some things become obsolete and all you can do then is try to import it in a compatible mode or use an older compiler.
There is a VS2017 solution in the SDK package, you will likely need to install VS2017 to get it compileable.

2017 and 2019 can exist side-by-side without conflicts.

I can't guarantee you will have any success getting the package to build, though. A quick rummage around in the SDK there are too many things in the package that seem to be dependent on VS2010 and/or 2017.

https://visualstudio.microsoft.com/vs/older-downloads/

VS2010 is not free in the downloads available. VS2017 (and 2015/2019) have the Community Edition.
Topic archived. No new replies allowed.