Is it possible to build v142 project with v143 build tools?

56 Views Asked by At

The problem is following:

  • One of our VS C++ project files is for v142 build tools and it succesfully buildable with MS Build Tool 2019 on our 'build machine'
  • but locally (and also on 'build machines' for other customers) I need to build the same VS C++ project with MS Build Tool 2022 (which use v143 build tools)

Is it possible to build VS C++ v142 project with newer version is MS Build Tools?

So, I want to keep the same VS C++ project file but have it buildable with MS Build Tools 2019 and 2022. Is it possible at all?

1

There are 1 best solutions below

0
SHR On

Assuming you are talking about a DLL or static library with a v142 toolkit and you want to use it as a dependency of a project (DLL or EXE) with other toolkits, there are several cases:

  • if the dependant is a static library, both must use the same toolkit, because the static lib must be linked with the same toolkit it has been compiled for.
  • if the dependant is a DLL that exposes C++ types, (like std::string, std::list etc.) in its API; (dllexport) the toolkit of both projects must be the same, since the types aren't the same when using other toolkit.
  • if all DLL exported types are atomics (like integers, or pointers) each can be compiled with a different toolkit.

Changing the toolkit is not a big issue, if you need to compile it on both toolkits, duplicate the debug and release configuration, and change the toolkit for the new configurations.