How do I get Visual Studio Code indicates an error in a C++ code?
Installed extensions: С/С++; С/С++ Clang and C++ and C++ Intellisense.
Set the path:
"name": "Win32",
"includePath": [
"D:/programm/MinGW/lib/gcc/mingw32/5.3.0/include/c++"
],
"browse": {
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
but errors are not displayed.
In order to get Visual Studio Code indicates errors, create a simple project and use the next VScode configuration:
C/C++
, C/C++ Clang Command Adapter
, C++ Intellisense
, Easy C++ projects
Ctrl + Shift + P
and type Easy Cpp/C++: Create new C++ project
.vscode\\c_cpp_properties.json
with the next content:{
"configurations": [
{
"name": "Win32",
"includePath": [
"C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.10150.0\\ucrt"
],
"intelliSenseMode": "msvc-x64",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio 14.0/VC/bin/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17"
}
],
"version": 4
}
If you see in a terminal the "Hello Easy C++ project!" message, hence the configuration is done. You can easily modify this configuration for your needs.
Possible difficulties:
c_cpp_properties.json
build.bat
file has the right path to the compiler.clang.executable
are set up in a Workspace Settings
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.