QT6.2.1 moc.exe includes wrong directory
-
Dear all
I upgraded an application from QT5.12 to 6.2.1 successfully on my local machine (win 10).
I use a continuous integration system (Windows Server 2016) where I got an error: Parse error at "attribute"
I found out that on the server, moc.exe includes folders from
-Ic:/mingw/lib/gcc/mingw32/6.3.0/include/c++/...
on my machine it include
-IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/...
which is correct.On both machines c:\minGW is installed
When I rename the folder c:\minGW it works, but this is not a solutionI compile with qmake -o Makefile CpsCommand.pro and have the same issue in the IDE
Has somebody an idea where moc.exe gets the information to include folders from c:\minGW or how to setup the correct include path?
Here is the complete generated console output of
local machine:
C:\Qt\6.2.1\mingw81_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_PRESENCE -DWINDOWS -DUSE_BASSERT -DQT_QML_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include C:/_Projects/Noscere/trunk/02_SW/CpsCommand/debug/moc_predefs.h -IC:/Qt/6.2.1/mingw81_64/mkspecs/win32-g++ -IC:/_Projects/Noscere/trunk/02_SW/CpsCommand -IC:/_Projects/Noscere/trunk/02_SW/DoorApplication/01_Source/Framework/Utilities -IC:/_Projects/Noscere/trunk/02_SW/DoorApplication/01_Source/Framework/Interface/ProtocolDefinitions -IC:/_Projects/Noscere/trunk/02_SW/DoorApplication/01_Source/DataTransferObjects -IC:/_Projects/Noscere/trunk/02_SW/TofDataAnalyser/include -IC:/Qt/6.2.1/mingw81_64/include -IC:/Qt/6.2.1/mingw81_64/include/QtWidgets
-IC:/Qt/6.2.1/mingw81_64/include/QtGui
-IC:/Qt/6.2.1/mingw81_64/include/QtSerialPort -IC:/Qt/6.2.1/mingw81_64/include/QtCore
-IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++
-IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/x86_64-w64-mingw32
-IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include/c++/backward
-IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include
-IC:/Qt/Tools/mingw810_64/lib/gcc/x86_64-w64-mingw32/8.1.0/include-fixed
-IC:/Qt/Tools/mingw810_64/x86_64-w64-mingw32/include mainwindow.h -o debug\moc_mainwindow.cppserver:
C:\Qt\6.2.1\mingw81_64\bin\moc.exe -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DQT_DEPRECATED_WARNINGS -DQT_PRESENCE -DWINDOWS -DUSE_BASSERT -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_SERIALPORT_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN --include F:/_Projects/Noscere/trunk/02_SW/CpsCommand/release/moc_predefs.h -IC:/Qt/6.2.1/mingw81_64/mkspecs/win32-g++ -IF:/_Projects/Noscere/trunk/02_SW/CpsCommand -IF:/_Projects/Noscere/trunk/02_SW/DoorApplication/01_Source/Framework/Utilities -IF:/_Projects/Noscere/trunk/02_SW/DoorApplication/01_Source/Framework/Interface/ProtocolDefinitions -IF:/_Projects/Noscere/trunk/02_SW/DoorApplication/01_Source/DataTransferObjects -IF:/_Projects/Noscere/trunk/02_SW/TofDataAnalyser/include -IC:/Qt/6.2.1/mingw81_64/include -IC:/Qt/6.2.1/mingw81_64/include/QtWidgets -IC:/Qt/6.2.1/mingw81_64/include/QtGui -IC:/Qt/6.2.1/mingw81_64/include/QtSerialPort -IC:/Qt/6.2.1/mingw81_64/include/QtCore
-Ic:/mingw/lib/gcc/mingw32/6.3.0/include/c++
-Ic:/mingw/lib/gcc/mingw32/6.3.0/include/c++/mingw32
-Ic:/mingw/lib/gcc/mingw32/6.3.0/include/c++/backward
-Ic:/mingw/lib/gcc/mingw32/6.3.0/include -Ic:/mingw/include
-Ic:/mingw/lib/gcc/mingw32/6.3.0/include-fixed
-Ic:/mingw/mingw32/include mainwindow.h -o release\moc_mainwindow.cpp
:/Qt/6.2.1/mingw81_64/include/QtCore/qnamespace.:56:1: error: Parse error at "attribute" -
Make sure nothing of the MinGW path is in the environment (PATH, INCLUDE, LIB) and try again.
-
In the mean time I found that it has something to do with the context the process is running. It works in the context of my user, MinGW is not in the path. But the BuildServer is working in the context of the system user and printing out the path in this context I see C:\MinGW\Bin.
I removed all MinGW strings in the registry. Still the same.Is there no way to specify where qmake shall search for includes?
-
I found a workaround. In the batch process I added the path of QT\MinGW... at the first entry and removed the Path C:\MinGW.
It works but I am not satisfied. It's the question of time till the next developer runs into the same issue. The path should be explicitely configurable in QT. -