我已经将c_cpp_properties.json设置为:
{
"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
}它报告:包含检测到的错误。请更新您的includePath。此翻译单元(/Users/.../.cpp)禁用Squiggles。C/C++(1696)无法打开源文件“QtCore/qstring.h.h”(依赖于"QTime")`
发布于 2019-12-10 18:15:51
编译器正在查找"QtCore/qstring.h"。根据您已经指定的包含路径,我猜它将位于...
"/usr/local/Cellar/qt/5.13.2/include“
因此,您需要将其添加到包含路径列表中。
发布于 2020-08-24 16:05:55
添加
"compileCommands": "${workspaceFolder}/build/compile_commands.json",添加到您的配置文件。
https://stackoverflow.com/questions/59258777
复制相似问题