msauer75
msauer75

Reputation: 1

qglobal.h file not found in Vscode

I want to use vscode to create a c++ application with Qt 6.8.1. If I want to include QtCore/qglobal.h in my code I will get the follwing error message:

'QtCore/qglobal.h' file not found clang(pp_file_not_found)

In the settings file I added the include path

{
    "settings": {
        "workbench.colorTheme": "Default Dark Modern",
        "workbench.iconTheme": "vs-seti",
        "files.associations": {
            "qjsonobject": "cpp",
            "qjsondocument": "cpp",
            "qstring": "cpp",
            "qjsonarray": "cpp",
            "qobject": "cpp"
        },
        "cmake.buildDirectory": "${workspaceFolder}/_Build/${buildType}",
        "cmake.cacheInit": null,
        "C_Cpp.default.includePath": [
            "${default}",
            "${workspaceFolder}/**",
            "/opt/Entwicklung/Qt/6.8.1/gcc_64/include/**"
        ],
        "intelephense.environment.includePaths": [
            "/opt/Entwicklung/Qt/6.6.3/gcc_64/include/**"
        ],
        "C_Cpp.default.cppStandard": "c++23",
        "cmake.cmakePath": "/opt/Entwicklung/cmake/bin/cmake",
        "C_Cpp.default.intelliSenseMode": "linux-clang-x64",
        "C_Cpp.formatting": "clangFormat",
        "C_Cpp.default.compilerPath": "",
        "C_Cpp.default.systemIncludePath": [
            "/opt/Entwicklung/Qt/6.8.1/gcc_64/include/**"
        ],
    }
}

Qt6 is installed in /opt/Entwicklung/Qt

I don't know where the problem is. Can you help me to solve this? Thank you for your help. BR martin

I added the Qt6 included path in vscode.

Upvotes: 0

Views: 31

Answers (0)

Related Questions