1
votes

I've set c_cpp_properties.json to be:

{
    "configurations": [
        {
            "name": "Mac",
            "includePath": [
                "${workspaceFolder}/**",
                "/usr/local/Cellar/qt/5.13.2/include/QtCore"
            ],
            "defines": [],
            "macFrameworkPath": [
                "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks"
            ],
            "compilerPath": "/usr/bin/clang",
            "cStandard": "c11",
            "cppStandard": "c++17",
            "intelliSenseMode": "clang-x64"
        }
    ],
    "version": 4
}

it reports: include errors detected. Please update your includePath. Squiggles are disabled for this translation unit (/Users/.../.cpp).C/C++(1696) cannot open source file "QtCore/qstring.h" (dependency of "QTime")```

2

2 Answers

0
votes

The compiler is looking for "QtCore/qstring.h". Based on the include path you've already specified I guess that will be under...

"/usr/local/Cellar/qt/5.13.2/include"

So you need to add that to your list of include paths.

0
votes

add

"compileCommands": "${workspaceFolder}/build/compile_commands.json",

to your config file.

See Visual Studio Code on macOS + Qt + Intellisense