Boost build a new version with VS 2019 - c++

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.

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 glut on visual studio 2013

I'm trying to compile the freeglut utilities from http://freeglut.sourceforge.net/docs/install.php Compiling instructions are not provided for Visual Studio 2013 and I don't see any solution file, nor a visual studio folder.
The instructions for windows are provided in README.win32 and it seems to support being built with cygwin or mingw only.
Frankly I would create my own vcxproj for it and add the cpp files indicated by the buildscripts manually until it builds. That will, at least, ensure that the resulting dll uses the same c-runtime settings as the rest of my Visual Studio projects, produces MSVC compatible libs etc.
Alternatively the freeglut download page does link some 3rd party pre-compiled windows binaries that will either be very convenient to use - or a total #!! ache if its built with a c-runtime linkage that disagrees with your project.

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.

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.

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.