MSBuild using the wrong cl.exe when building with the 2015 C++ v140 Platform Toolkit

246 views Asked by At

We're currently making a build environment for some of our projects. In particular we're using VC++ 6.0 and VS2019 to build some of these projects.

When building our C++ project in VS2019 with the Platform Toolkit set to C++ 2015 v140, MSBuild attempts to use the VC++ 6.0 compiler to build the project. If I switch the Toolkit to any other version it builds with the correct cl.exe.

If I remove the VC98 folder that contains cl.exe from the path environment variable I get a cl.exe can't be found error in VS2019. So I think there's something hardcoding the 2015 toolkit against the VC6.0 cl.exe.

I've tried installing and reinstalling the additional components in the VS Installer but no luck. Repair of VS2019 didn't fix it either. I've tried all versions of Visual Studio back to 2013 same issue. This looks like an MSBuild issue, it's in the wrong location. Is there any place where I can view the mapping for the toolkits in MSBuild? I couldn't see much in the registry.

The output when I build shows the following, the version is clearly a very old compiler (the VC6.0 one):

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
0

There are 0 answers