I installed the C/C++ Extension for Visual Studio Code (ms-vscode.cpptools
) and I'm trying to compile a .cpp file, but I keep getting fatal error C1034: iostream: no include path set
.
Here is the contents of tasks.json
:
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: cl.exe build active file",
"command": "cl.exe",
"args": [
"/Zi",
"/EHsc",
"/Fe:",
"${fileDirname}\\${fileBasenameNoExtension}.exe",
"${file}"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": [
"$msCompile"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
Here is the contents of c_cpp_properties.json
:
{
"configurations": [
{
"name": "Win32",
"defines": [
"_DEBUG",
"UNICODE",
"_UNICODE"
],
"windowsSdkVersion": "8.1",
"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.26.28801/bin/Hostx64/x64/cl.exe",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "msvc-x64"
}
],
"version": 4
}
and here is the exact output:
> Executing task: cl.exe /Zi /EHsc /Fe: c:\Users\User\Documents\C\cpp_workshop-cpp_ex2\main.exe c:\Users\User\Documents\C\cpp_workshop-cpp_ex2\main.cpp <
Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24213.1 for x86 Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
c:\Users\User\Documents\C\cpp_workshop-cpp_ex2\main.cpp(21): fatal error C1034: iostream: no include path set
The terminal process terminated with exit code: 1
Help me, Stack Overflow. You're my only hope!