Advertisement

boost thread linking errors

Started by December 24, 2020 12:38 AM
2 comments, last by cignox1 3 years, 11 months ago

Hello all, several years far from this site (not much time to spend on my pet projects) but now I come hoping for some help, like in the good old days :D

I'm trying to compile one of my old projects (a raytracer, 10 years have passed since my last work on it!), so I've installed Visual Studio, downloaded a few libs (assimp, FreeImage, SDL) updated the code for the new libraries etc. The project compiles just fine, or so it seems.

For boost, I've just downloaded and installed the sdk: I dont'think this was the standard procedure 10 years ago (I think I had to compile it) but this is much faster.

But I'm getting:

1>LINK : fatal error LNK1104: impossibile aprire il file 'libboost_thread-vc142-mt-x64-1_75.lib'

The thing I don't understand is that I'm linking against libboost_thread-vc141-mt-x64-1_75.lib (vc141, not vc142) and I can't understand where is that file reference coming from, I can't find it anywhere!

I'm a bit rusty with c++/Visual Studio, any idea? Thank you!

There are many places it could come from. Project settings, build settings, project property sheets, even #pragma commands in the .cpp files. Thankfully these are all text files in modern projects, so scan your directory tree for that 141 or 142 string.

Another source is automatic dependencies for versions of the compiler. The libraries for vc141 are the 2017 compiler, the libraries for vc142 are the 2019 compiler. It is possible a project file is marked as using Visual C++ 2017, another project file is marked as using Visual C++ 2019, and something is trying to reference both of them.

Assuming the various versions are installed you can override which version of the compiler you want to use in the project settings, under “Configuration Properties > General > Platform Toolset”. It is a drop-down box, and can be set for each configuration (debug x64, release x32, custom configurations, etc.) individually.

Advertisement

Thank you for replying! I could not find the issue, maybe auto-linking was trying to automatically find the file? Don't know. I've checked out the boost source and compiled it. I also had to do the same thing with assimp (I almost forgot how it was working with C++ XD).

Now I can compile and run the raytracer: only a black window is shown, maybe SDL2 works differently, or the raytracer is broken by the x64 compilation (hope not!)

Thank you again!

This topic is closed to new replies.

Advertisement