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

Project ERROR: Cannot run compiler 'g++' (Windows)



  • Hello,

    I coded this morning with QtCreator (Qt 5.12.4, Windows 10, MinGW 7.3 32 bits), all was okay. I restart QtCreator few hours ago and open again my project, which follow with this error message :

    Error while parsing file C:\MG\LPP\Programmation\LPP_Maquette\LPP_Maquette.pro. Giving up.
    Le chemin d'accŠs sp‚cifi‚ est introuvable.
    Project ERROR: Cannot run compiler 'g++'. Output:
    ===================
    # 1 "C:/Qt/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
    # 1 "<built-in>"
    # 1 "<command-line>"
    # 1 "C:/Qt/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
    QT_COMPILER_STDCXX = 201402L
    # 26 "C:/Qt/5.12.4/mingw73_32/mkspecs/features/data/macros.cpp"
    QMAKE_GCC_MAJOR_VERSION = 7
    QMAKE_GCC_MINOR_VERSION = 3
    QMAKE_GCC_PATCH_VERSION = 0
    ===================
    Maybe you forgot to setup the environment?
    

    This message appears even when I create a new project. The only file which is displayed on QtCreator is the .pro file.

    I looked up my settings of QtCreator but all seems okay :

    5c7f7e79-c23e-4f10-98ef-21098f0367e9-image.png
    7d6dd6d2-4856-499f-9cd0-6788d5fd7151-image.png
    9f4ad075-504d-4c84-91c1-d446516c3d5b-image.png
    441c8414-8584-415b-ac39-f10d81c07724-image.png

    For information, I already add the path of Mingw in the environment variables but no sucess :
    a2833d1a-756c-4d81-bdab-c50d730d09a1-image.png

    Do you know where it can come from ? I have not a lot of experience in QtCreator, Cmake, etc so I have a little lost.
    Thank you in advance for your help.


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    You have several different versions of MinGW installed. You should remove the one that you did not install with Qt from the PATH environment variable.



  • I delete the C:\MinGW\bin path from the "PATH" environment variables. But I have still same errors :

    cb4f854b-7f08-418e-acbd-3c562d333898-image.png

    Do you have others clues ? ^^



  • @mgauquelin
    I still see at least C:\Qt\Tools\mingw730_32\... & C:\Qt\5.12.4\mingw73_32\... on your PATH. In fact, you now have more elements there than before. We don't know how these might interfere. You only need one of these, don't you (or do you really need all 4, I don't know)? Does one of those directories indeed contain the g++ executable?



  • I try with only one and after I added the 3 others to test. But indeed I get back to only one (Tools\mingw\bin) which contains g++.exe yes.