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

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.

Related

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.

Installing socket.io C++

I try to work with socket.io in C++ but I can't seem to get the example running.
First it asked me to convert the project to my visual studio (which is 2015). So I did that. Then it was missing libraries offcourse (boost, websocket++, rapidjson). So I added them to the additional libraries in the project settings. Then it was searching for boost.lib. Boost.lib doesnt exist in the boost library I installed on my pc, so I deleted it from the dependency list. I figured I already included boost, why would it search for a lib that doesn't exist. I ran bjam.exe and b2.exe etc from boost, so if there would be a boost.lib it should be there I guess and it isn't.
I then got this error: https://msdn.microsoft.com/en-us/library/f6xx1b1z.aspx
So I added msvcrt.lib and msvcmrt.lib to the linker's Additional Dependencies property. Which caused the errors in the included image..
Now all the steps seemed to fix the problems I had, but also create more errors in the process. I do not understand how to run a project like this and I can't find a good explanation of the steps I need to take.
Can anyone explain what I am doing wrong?
https://github.com/socketio/socket.io-client-cpp
That is what I try to run, the included SioChatExample
Thanks for any help in advance!
Current errors..... :(
i think many errors because of VC++ version.
creator of project Socket.io-c++, he used VC++ 11.0
if you use VC++ 14.0 to build it, you will get the error. for suggestion you should use VC++ 12.0
In cast you want to use prebuilt libraries:
i myself just try many solutions,
goodness i fix all
you can get them here Prebuilt-libraries-for-Socket.io-c++
for Visual Studio 2015, what u need are:
install more Visual Studio 2013 (i install Visual Studio 2013 community) to get VC++ 12.0 (prebuilt-lib is built in VC++ 12.0)
change your project Platform Toolset to Visaul Studio 2013 (v120)
link libraries to your project
libraries you need are:
libboost_date_time-vc120-mt-gd-1_50.lib
libboost_random-vc120-mt-gd-1_50.lib
libboost_system-vc120-mt-gd-1_50.lib
sioclient.lib
include folder of *.h (header of Socket.io-C++) to your project
build and run

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

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.

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?

Visual Studio - forcing a project to use an earlier version of Boost?

For now, I just want to get a clean compile. Will document the issues and rebuild Boost later.
I have vc90 installed of Boost, but Visual Studio is looking for vc100:
error LNK1104: cannot open file 'libboost_thread-vc100-mt-gd-1_47.lib'
I have installed:
libboost_thread-vc90-mt-1_47.lib
Is there somewhere I can change it so it uses vc90?
No - c++ libraries are not compatible - one compiler (one version) and a matching library.
In your case install boost libraries for vc100 or downgrade to vc90.