Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Unable to compile with MSVC 2019 - Cannot run cl.exe, but vcvarsall.bat looks all correct



  • I get "C++ and C compiler paths differ" warning at startup of QtCreator:
    a1165676-65e3-456c-8259-4b1745b6f8cc-image.png

    And this:
    ec8f37b5-835f-4519-8592-811aa802bcad-image.png

    Upon building. I've made sure MSVC 14 - 19 are installed using the VS installer tool. And I've also located vcvarsall / vcvars64 / vcvars32.bat, and they run correctly. And once run manually from the command line, I can call "cl.exe" from the command line.

    I tried adding this to my Path env var:

    C:\Program Files (x86)\Microsoft Visual Studio\2019\Preview\VC\Tools\MSVC\14.29.30031\bin\Hostx86\x86;

    the location of cl.exe and that just causes include errors etc. So it appears, even though Qt knows where to find vcvarsall.bat:

    4324b9c4-e58d-4e6e-bd3c-e03f02f6d12b-image.png

    something still is not set right. Any ideas of how to fix this issue? Other similar posts with answers don't resolve it for me.

    So something tells me the first Qt Creator startup warnings are saying something important. How do I make sure the C++ / C compiler paths are the same?



  • Re: [Unable to compile with MSVC 2019 - Cannot run cl.exe](but vcvarsall.bat looks all correct)

    I built SymbolicC++ as a static library but found out its much easier just to INCLUDEPATH a subdirectory made up of all the header files.

    So I was able to switch back to MinGW kit, which "solves" this for me.


Log in to reply