Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. QT6.2.1 moc.exe includes wrong directory

QT6.2.1 moc.exe includes wrong directory

Scheduled Pinned Locked Moved Solved Qt 6
4 Posts 2 Posters 1.4k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • I Offline
    I Offline
    Inok
    wrote on 17 Jan 2022, 15:37 last edited by
    #1

    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 solution

    I 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.cpp

    server:
    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"

    1 Reply Last reply
    0
    • C Offline
      C Offline
      Christian Ehrlicher
      Lifetime Qt Champion
      wrote on 17 Jan 2022, 16:46 last edited by
      #2

      Make sure nothing of the MinGW path is in the environment (PATH, INCLUDE, LIB) and try again.

      Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
      Visit the Qt Academy at https://academy.qt.io/catalog

      1 Reply Last reply
      0
      • I Offline
        I Offline
        Inok
        wrote on 18 Jan 2022, 08:45 last edited by
        #3

        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?

        1 Reply Last reply
        0
        • I Offline
          I Offline
          Inok
          wrote on 18 Jan 2022, 15:08 last edited by
          #4

          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.

          1 Reply Last reply
          0
          • J JoeCFD referenced this topic on 6 Feb 2023, 18:10

          1/4

          17 Jan 2022, 15:37

          • Login

          • Login or register to search.
          1 out of 4
          • First post
            1/4
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved