Visual Studio Code将我的所有过剩功能强调为未定义,但完美编译。如何在不停用语法高亮的情况下摆脱红色下划线?
包含main.h
:
#include <stdlib.h>
#include <GL/glew.h>
#include <GL/glut.h>
#include <math.h>
#include <string>
我将所有可以想到的路径添加到c_cpp_properties.json
文件中的包含路径和浏览路径部分。
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/include/GL",
"/usr/local/include",
"${workspaceRoot}",
"/usr/include/x86_64-linux-gnu/c++/5",
"/usr/include/c++/5",
"/usr/lib/x86_64-linux-gnu"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/include/GL",
"/usr/local/include",
"${workspaceRoot}",
"/usr/include/x86_64-linux-gnu/c++/5",
"/usr/include/c++/5",
"/usr/lib/x86_64-linux-gnu"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
我在Ubuntu 16.04上使用Visual Studio Code 1.18,我的构建命令是:
g++ -g main.cpp -L/usr/lib/x86_64-linux-gnu -lGL -lglut -lGLEW -lGLU
有什么想法吗?
答案 0 :(得分:0)
在"C_Cpp.intelliSenseMode": "Tag Parser"
中设置settings.json
可以解决问题。非常感谢@Bob __