Upgraded C++ Project to VS2015, but the Linker is still looking for VC100 Boost library - c++

I have upgraded my C++ project from VS2008 to VS2015.
The Platform Toolset is set to Visual Studio 2015 (v140). If it matters, the Target Platform Version is set to 8.1.
I built boost using toolset=msvc-14.0 and put the built libraries into the place my project is expecting them.
When I build my project, I get a linker error:
LNK1104 cannot open file 'libboost_thread-vc100-mt-1_43.lib'
Why is it looking for the vc100 library and not the vc140 one?
It's the first project out of 2 that is failing.
In the .vcproj file there is no reference that I can see to vc100.

Linking to boost libraries on Windows is done automatically through auto linking and #pragma directives. The version number it looks to link against is defined in boost\config\auto_link.hpp where it goes through a bunch of #if and #elifs on your MSVC version and if the version is higher than any of the ones it knows about then it just sets the version number to the highest one it knows about. For boost 1.57 that is vc140, for your version of boost that is presumably vc100.

Related

Boost build a new version with VS 2019

I downloaded the latest version from https://www.boost.org/ and I need to build in VS2019 (C++, 32bits) when I build the files contains mt and the toolset
My question is how I can remove the mt and the toolset from the lib and dlls ?
Boost library file names describe what they support and how they were built. In your case they support multithreading and were built with VS2019 (as opposed to MinGw, Clang or an earlier version of visual studio). For more information see: how can i decode boost library naming.
boost uses auto linking with visual studio, see how boost auto linking makes choice, so the library file names must match those that are required.
You haven't said why you want to "remove the mt and the toolset from the lib and dlls".
If it is to get boost to link with an existing project, then you'll need to build boost with the correct version of visual studio and without multi-threading, e.g.:
b2 toolset=msvc-??? threading=single ...
See: b2 invocation properties.

Boost library file generation

I am trying to compile boost 1.52 library files with Visual studio 2013. To do so, run the file b2 with the visual studio prompt command.
Everything seems to run correctly . However, the lib files that I am getting in /stage/lib/ have no version of VC. For example, I have
libboost_date_time-vc-mt-1_52.lib
My dynamic libraries require
libboost_date_time-vc110-mt-1_52.lib
When I rename all files by substituing vc with vc110, it works as a charm, but it is a very fastidious process.
I made some researches and I could see that one could control the version of Boost with respect to the version of VS. I tried the following command
b2 toolset=msvc-12.0
Yet, I still get the versionless file.
How do I make it work ? Thanks.
boost 1.52 was released in 2012. At this time, Visual Studio 2013 was not an existing compiler.
You are compiling a library with a not officially supported compiler. You're actually even lucky that boost 1.52 compiled with Visual Studio 2013.
It's not surprising that b2 is unable to add vc110 to your libraries names. There may be a case statement somewhere in boost build system configuration files that has a version name for every "supported" compilers....and there may be no vc110 there...
You need either to take the first boost version supporting Visual Studio 2013 or use Visual Studio 2010 compiler (which is supported by 1.52)....or rename the files manually as you did.
By the way, note that renaming the libraries will make auto-link fail if you are plannign to use it. See boost\config\auto_link.hpp: this explicitely handle every compiler version....will only work with officially supported compilers.

Qt module error - LNK 1112 in QtOpenGL

I am trying to build a project (x64) connected with Qt library in Microsoft Visual Studio 2010. The project I want to compile was built using Visual Studio 2008.
I have all the dependencies added, downloaded compiled the Qt library 64-bit and done all the proper changes in project properties in VS 2010. Although, I get the error below:
Error 2616 error LNK1112: module machine type 'X86' conflicts with
target machine type 'x64' D:\project\Windows\QtOpenGL4.lib(QtOpenGL4.dll)
I have checked my .dll and .lib files and they are an in x64 bit version. Also, my QtOpenGL4.dll file is in another path from the one mentioned in error.
Could it be an error from the QtOpenGL4 module? How could I solve this? Could you please help me?
The instructions I followed in order to build the 64-bit version of Qt are in this link : https://en.wikibooks.org/wiki/Opticks_Developer_Guide/Getting_Started/Building_Qt_From_Source
Finally I found a solution in my error. I compiled again the Qt library in 64-bit and entered all the proper values in project Properties. I also entered the proper path in
Project Properties -> Linker ->Input ->Additional Dependencies.
With the right paths it solved the linkage error for me.
I have to mention that I also downloaded the precompiled libraries from the answers in this link
How to compile Qt for 64-bit Windows from a 32-bit environment with Visual C++ 2010 Express?
You are probably trying to link your 64-bit project with 32-bit Qt libraries.
This says more about the error you are facing.
Similarly, if you create one module with the x64 compiler and another
module with the x86 compiler, and try to link them, the linker will
generate LNK1112.
Check if you are using 64-bit precompiled Qt libraries.

VS12 Buiding Boost Library fatal error LNK1104: cannot open file 'libboost_system-vc110-mt-gd-1_58.lib'

I've been trying to build boost:asio for Visual Studio 2012.
I already did bjam and it gave me the include and lib addresses, which I pasted in VS settings.
Now compiler can't find 'libboost_system-vc110-mt-gd-1_58.lib', but in stage lib I got the 'libboost_system-vc120-mt-gd-1_58.lib', that is probably a newer version.
How can I solved this?
I searched it for days and couldn't get through this.
Looks like you are using VisualStudio 2012 (is requesting vc110 version libraries) but you actually have build boost for Visual Studio 2013 (vc120).
You need to specify the right toolset to boost build (--toolset=msvc-11.0) and not let him pick the default.
Are you using an older-than-last version of boost?
Make sure that your version does not predate the support for VS2012. The mechanism for detecting the version is different in bjam and in the autolink headers, so that with recent versions of Visual Studio you can end up trying to link to the latest version known of boost "vc110", even though bjam detected it correctly.

MSVCR100D.dll is missing when build/running project from another PC/VS

I uploaded my (VS2013) project folder and provided it to the other members of my team, but when they tried to build/run it, using Visual Studio 2012 they got this error, it also happened on their version of Visual Studio 2013.
The program can't start because MSVCR100D.dll is missing from your computer. Try reinstalling the
program to fix this problem.
They reinstalled VS2010 but no go.
I also tried to statically link my project by using /MT in the Code Generation options but now I get:
Unresolved External Symbol __free_dbg libcmptd.lib cout.obj
....25 more...
How can I get it so my project can be build/ran on my team members pc? How do I resolve the unresolved externals? It seems to happen purely with regular Microsoft files.
You are mixing C++ libraries built with different versions of the compiler (and as we know some of them are linked against debug dynamic version of VC10 runtime library). This is not supported, as different compiler versions have different ABIs.
To fix the mess you need to find libraries built with parameters that match parameters of your project. They should be built:
with the same compiler version (ex. VS 2013)
with the same configuration (Debug/Release)
against the same platform (x86/x64/ARM)
against the same runtime library variant (static/dynamic + debug/release)
You could either try to find prebuilt versions on the web or to build libraries yourself from source codes. Often, you will want to have multiple configuration/platforms for your project and, thus, you will need multiple versions of your libraries.
If your search will not succeed (for example if there is no VS2013 build for a closed source library) you could roll back your project to another version of compiler and to start over.
Any attempts to link incompatible libraries even if somehow succeeded will lead to random crashes.
This message generally states that the dll is referred to directly or indirectly in your application and is missing.
The 'D' at the end show us this is the Debug version of the file, this is DLL file is provided with the Visual Studio 2010 installation. So the MSVCR100D.dll would be provided with the installation of Visual Studio 2010.
Of course, you could be missing other versions 2008 (MSVCR90D) 2010 (MSVCR100D) 2012 (MSVCR110D) or the 2013 (MSVCR120D), each dll is provided according to the Visual Studio version.
There are a few ways to solve this:
Check to be sure that you're compiling all the components of your
project in Release mode. If this does not solve the issue continue
to the next steps.
You could solve this locally by installing Visual Studio 2010 on your
machine. This is not what I would recommend, but it would surely
overcome the issue
You could also download the file from this third party website and
copy it to your projects bin:
http://www.dll-files.com/dllindex/dll-files.shtml?msvcr100d
This option is the LEAST recommended option.
Run dependency Walker and see what file depends on the MSVCR100D.dll
and the try and fix that file in order to break your dependency. You can download depends here: http://www.dependencywalker.com/
Check to be sure that you're project is linking the correct version of
the CRT and any other libraries you may be using (e.g., MFC, ATL,
etc.)
Note: Installing the redistributables alone will NOT solve this problem, since the redistributables only contain the release version of the file MSVCR100.dll (notice no 'D')
Would it be possible that in your project you are somehow using some component/library built with Visual Studio 2010, which requires the MSVCR100D DLL?