Closed Xiaohong-Deng closed 4 years ago
You should remove the system include paths from your includePath and instead set the compilerPath. Are you trying to compile with gcc 7.3 or clang?
@sean-mcmanus You are right. I trimmed includePath
down to "${workspaceFolder}/**"
. The other paths were added while I was trying to make it work with gcc and they did eliminate some header file missing errors. Thank you.
Type: LanguageService
Describe the bug
In the "Problems" panel, 72 errors are thrown while the
cpp
file compiles okay in terminal (depends on the specific complier, some requires minor changes, e.g., 7 variable-sized object errors which are allowed in some compilers). The issue is similar to #743."C_Cpp.intelliSenseEngine":"Tag Parser"
stops linting completely.Steps to reproduce
My working example is this .cpp file and this .h file. The repo is the single project in VSCode.
My
c_cpp_properties.json
looks like the followingThe result can be seen in the "Problems" panel. It can't recognize
make_tuple
,tie
,unordered_map
,memcpy
andmemset
while pressing F12 leads to correct definitions.Expected behavior
This is an OSX specific issue because on Ubuntu 18.04, with
The errors appear in the "Problems" panel are 7
variable-sized object may not be initialized
which are consistent with the error message generated byclang++ -g -O2 -std=c++11 -stdlib=libc++ local_search.cpp -o ls.out
in OSX terminal.Logs
``` -------- Diagnostics - 5/22/2020, 9:23:57 AM Version: 0.28.1 Current Configuration: { "name": "Mac", "includePath": [ "${workspaceFolder}/**", "/usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/tr1", "/usr/local/Cellar/gcc/7.3.0_1/lib/gcc/7/gcc/x86_64-apple-darwin17.3.0/7.3.0/include/ssp", "/usr/local/Cellar/postgresql/10.1/include/server/common", "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include", "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include", "/usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0", "/usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/x86_64-apple-darwin17.3.0" ], "defines": [], "macFrameworkPath": [], "browse": { "path": [], "limitSymbolsToIncludedHeaders": true }, "compilerPath": "/usr/bin/clang", "cStandard": "c11", "cppStandard": "c++14", "intelliSenseMode": "clang-x86", "compilerArgs": [] } Memory Usage: 106 MB Compiler Path: /usr/bin/clang Includes: /usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/tr1 /usr/local/Cellar/gcc/7.3.0_1/lib/gcc/7/gcc/x86_64-apple-darwin17.3.0/7.3.0/include/ssp /usr/local/Cellar/postgresql/10.1/include/server/common /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include /usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0 /usr/local/Cellar/gcc/7.3.0_1/include/c++/7.3.0/x86_64-apple-darwin17.3.0 /usr/local/include /Library/Developer/CommandLineTools/usr/include/c++/v1 /Library/Developer/CommandLineTools/usr/lib/clang/11.0.3/include /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include /Library/Developer/CommandLineTools/usr/include Frameworks: /Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks Standard Version: c++14 IntelliSense Mode: clang-x86 Other Flags: --clang --clang_version=110003 Total Memory Usage: 106 MB ```Screenshots
Additional context