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

include MinGW include in QT Creator on Windows



  • Hello,

    I am using QT Creator 4.11.0 with MinGW on Windows 10 and I am trying to include header files from MinGW include path. They are visible by autocomplete but code parser complains it can't find it and compilation fails as well. Some 5 years old post I have found on the internet described the same problem and there it was solved by adding to path

    D:\Qt\Tools\mingw730_64\bin
    D:\Qt\5.12.0\mingw73_64\bin
    

    In my case the path was already set and the only thing that helped me was adding include folder manually in .pro file:

    INCLUDEPATH += D:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/
    

    The code compiles and works fine, however now I get a warning "The code model couldn't parse included file, which might lead to incorrect code completion and highlighting" with several header files listed from the newly included folder.

    The question is: is this warning an issue of Clang plugin and I am adding this include path correctly? Or should I set up MinGW in QT Creator in some different way?

    What confuses me is that in the debug folder for any project I see .qmake.stash file with the following content:

    QMAKE_CXX.INCDIRS = \
        D:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++ \
        D:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++/x86_64-w64-mingw32 \
        D:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/c++/backward \
        D:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include \
        D:/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include-fixed \
        D:/Qt/Tools/mingw730_64/x86_64-w64-mingw32/include
    QMAKE_CXX.LIBDIRS = \
        D \
        /Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/;D \
        /Qt/Tools/mingw730_64/lib/gcc/;D \
        /Qt/Tools/mingw730_64/x86_64-w64-mingw32/lib/;D \
        /Qt/Tools/mingw730_64/lib/;D \
        /Qt/Tools/mingw730_64/lib
    .....
    .....
    

    I am only guessing, since my understanding of the processes here is not deep, but it seems the include path in question is already known.

    Thanks


Log in to reply