Hello, so I am new to coding and wanted to use VS Code to code in C++, so I installed it, installed C/C++ IntelliSense v0.12.4 and followed instructions on the VS Code website to make a c_cpp_properties.json file and copied the code into it like they said. When I open my .cpp project that I had made in notepad++, I get the error:
"#include errors detected. Please update your includePath. IntelliSense features for this translation unit (directory\file.cpp) will be provided by the Tag Parser. (9, 1)
cannot open source file "iostream" (9, 1)"
My .cpp code
`#include
using namespace std;
int main()
{
string firstName, lastName;
double hourRate, numHours;
cout << "+----------------------------------------+" << endl;
cout << " Your first name and last name: ";
cin >> firstName >> lastName;
cout << " Your hourly rate: ";
cin >> hourRate;
cout << " Number of hours worked last week: ";
cin >> numHours;
cout << endl;
double regPay, overTPay, gPay, socSec, med, netPay;
if (numHours <= 40)
{
regPay = hourRate * numHours;
gPay = regPay;
overTPay = 0;
}
else
{
double oTHours;
oTHours = numHours - 40;
regPay = hourRate * (numHours - (numHours - 40));
overTPay = (hourRate * 1.5) * oTHours;
gPay = regPay + overTPay;
}
socSec = gPay * 0.062;
med = gPay * 0.0145;
netPay = gPay - (socSec + med);
cout << "+----------------------------------------+" << endl << endl;
cout << " Pay Stub\n" << " Regular pay $" << regPay << endl;
cout << " Overtime pay $" << overTPay << endl;
cout << " Gross pay $" << gPay << endl;
cout << " Social Sec. $" << socSec << endl;
cout << " Medicare $" << med << endl;
cout << " Net Pay $" << netPay << endl << endl;
cout << "+----------------------------------------+" << endl << endl;
cout << " Pay to: " << firstName << " " << lastName << endl;
cout << " Total Pay: $" << netPay << endl << "\t\t\t ";
cout << "Signed: P inc." << endl;
cout << "+----------------------------------------+" << endl;
return 0;
}`
My c_cpp_properties.json file
{
"configurations": [
{
"name": "Mac",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"includePath": [
"${workspaceRoot}"
],
"defines": [
"_DEBUG",
"UNICODE"
],
"intelliSenseMode": "msvc-x64",
"browse": {
"path": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/6.3.0/include/c++",
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
Also, when I hover over the "
"#include errors detected. Please update your includePath. IntelliSense features for this translation unit (E:\Stuff\CS11-Things\Homeworks\A3\paycheck.cpp) will be provided by the Tag Parser.
cannot open source file "iostream""
Let me know if you need any more information
Your includePath only has ${workspaceRoot}
. You need to add the path to your system directories. If you're using MinGW, see https://github.com/Microsoft/vscode-cpptools/blob/master/Documentation/LanguageServer/MinGW.md .
If you are using Linux you have to add the path /usr/include/linux
I had same issue on windows, after I add the "C:\\cygwin64\\lib\\gcc\\x86_64-pc-cygwin\\6.4.0\\include\\c++"
at includePath, I got this error: cannot open source file "bits/c++config.h" (dependency of "iostream")
What does gcc tell you the include path should be? Run this command and make sure all of the paths printed out are listed in your c_cpp_properties.json: gcc -v -E -x c++ -
@sean-mcmanus after adding the code from the link you gave it still complains, I didn't add "C_Cpp.intelliSenseEngine": "Default" to my settings.json file because I have no clue where it is. Anyway, this is the new error I am getting.
"#include errors detected. Please update your includePath. IntelliSense features for this translation unit (E:\\program.cpp) will be provided by the Tag Parser. (9, 1) cannot open source file "iostream" (9, 1)"
@NikoGP Go to File->Preferences->Settings and search for "intelliSenseEngine" to find the setting. You have "Default" set already though. Did you run the gcc command @bobbrow mentioned? Can you provide your updated c_cpp_properties.json? You basically need to find where your iostream header is getting pulled from by your compiler and add the path to the includePath setting (and make sure the defines are correct). Does Go to Definition work on the header file? If so, that means the iostream file was found via a recursive search of your browse.path setting.
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"configurations": [
{
"name": "Win32",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/mingw32",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/backward",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=5",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed",
"C:/MinGW/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"intelliSenseMode": "msvc-x64"
}
],
"version": 3
}
Here is my current c_cpp_properties.json file, when I hover over the "{" before configurations Win32 it says "missing property "name""
Also, I installed cygwin before installing MingW, I'm not sure if that messes anything up or not
I reformatted your comment. There is a "configurations" element inside your "configurations" which is invalid syntax for the c_cpp_properties.json file. Fix it like below:
{
"configurations": [
{
"name": "Mac",
"includePath": [
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
"/System/Library/Frameworks",
"/Library/Frameworks"
]
},
{
"name": "Linux",
"includePath": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
"/usr/include",
"/usr/local/include",
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
},
{
"name": "Win32",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/mingw32",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include/c++/backward",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
"C:/MinGW/include",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=5",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:/MinGW/lib/gcc/mingw32/5.3.0/include",
"C:/MinGW/lib/gcc/mingw32/5.3.0/include-fixed",
"C:/MinGW/include/*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}
],
"version": 3
}
Even using the code above @bobbrow VSC still complains and says;
"#include errors detected. Please update your includePath. IntelliSense features for this translation unit (E:\program.cpp) will be provided by the Tag Parser. (9, 1) cannot open source file "iostream" (9, 1)"
in the problems section below my code
What version of MinGW are you using? In your first post, it looked like you had 6.3.0 in your include path. In your most recent post, it looked like you pasted in include paths for 5.3.0 from our MinGW page.
Okay, I think that my problem lies in the fact that I had installed cygwin prior to MingW, and then I incorrectly installed the required packages for MingW to properly function.
Is there somewhere that I can find what packages I need to install for VS Code to work properly with MingW?
I am also having the issue seen by @NikoGP with my Intellisense after upgrading to v0.13.0. When I turned on the "Default" setting on the Intellisense engine, I keep receiving an iostream include path error (see attached files). I'm running MacOS 10.12.6, and have updated the LLVM engine as well.
The error under the iostream include is:
cannot open source file "wchar.h" (dependency of "iostream")
Simple "Hello World" example showing the error:
My c_pp_properties.json file:
@smithalexk, for me, this file resides in /usr/include
. What does clang -Wp,-v -E -xc -x c++ /dev/null
show as your include path? The "includePath" in your c_cpp_properties.json file should match that.
Yep that looks to have fixed it. Thanks for the help!
For reference, I was missing:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks
I'm new at coding, I installed Visual Studio code to code in c++ based on the instructions of https://code.visualstudio.com/docs/languages/cpp, after following all steps, I got a lot of error.
my c_cpp_properties.json file:
My tasks.json file:
My launch.json file:
My User Setting is:
The path of the FirstProg folder is :
@dorsa1986, what does g++ -Wp,-v -E -xc -x c++ /dev/null
show as your include path? The "includePath" in your c_cpp_properties.json file should match that.
Hi @dorsa1986, I also noticed that you spelled "iostream" incorrectly. You are currently including the "ioastream" header. That looks like it could be causing your error.
@smithalexk Thanks, I corrected but still, I got error
@bobbrow they matched.
According to that error, either your tasks.json is not building your program correctly, or your launch.json has an incorrect path to the built program. But this is not an issue with IntelliSense. I don't see any red squiggles in your editor.
how can I solve them?
Open tasks.json or launch.json (in the .vscode folder) and verify that they are correct
it's my launch.jason file:
This is my tasks.json:
I've been working on this about 4 days. I can't find my mistake.
Based on what I see in your previous posts, I'm going to guess that the path should be /Users/dorsat/Desktop/FirstProg/a.out
I got the same error.
Did you build it yet? Open your terminal or a Finder window and tell me where your compiled program lives.
@dorsa1986 Is a.out the name of the executable? Does it have executable permissions? Can you run it without VS Code from a command line?
When I built it from the VScode terminal, I got this error:
when I used Debug menu, I got this page:
Are you able to build in a Mac terminal? Try adding -std=c++11
to the command line.
@sean-mcmanus I'm new in coding, I think so. However, It's made automatically in my folder.
@bobbrow No, I'm not. I got the same error.
I got this error when I added -std=c++11 to the command line.
It looks like it's trying to compile your code as C code, not C++. Add -x c++
to the command line.
@bobbrow Do you have specific instructions for Mac book pro? to follow those steps and reinstall it. However, I've tried it several times based on https://code.visualstudio.com/docs/languages/cpp. But I've gotten the same error at each time. I can't find my mistakes.
There should be plenty of websites out there that can walk you through the steps of getting your code to build. This forum is for troubleshooting bugs in the VS Code Extension and your issue doesn't appear to be a bug since it doesn't appear to work for you in the terminal either.
I'm running out of ideas for you, but these came to mind:
I am trying to solve the same error "#include errors detected. Please update your includePath. IntelliSense features for this translation unit will be provided by the Tag Parser.'" and "cannot open source file "iostream"".
I have followed all the suggestions in this thread and now my browse.path and includePath are same as the entries found using "g++ -Wp,-v -E -xc -x c++ /dev/null".
However, I still cannot include iostream or atomic or stdio, basically any standard header. My own headers from a sub-directory are fine.
To be clear, mine is not a build issue (I'm using my own build system), but an intellisense issue. A peculiarity is that my code resides on a remote Ubuntu server, and I am running VS code on my Windows laptop with the Z: drive mounted to / on the server. I'd be grateful if anybody has any ideas.
Thanks.
Can you share the include path given by g++? Is it the path on the Ubuntu server or the mapped location on Windows? The includePath needs to match the filesystem of the OS you're working on (in this case Windows with the Z: path).
This is the output of the g++ command on the Ubuntu machine:
ignoring duplicate directory "/usr/include/x86_64-linux-gnu/c++/5"
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-linux-gnu/5/../../../../x86_64-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/5
/usr/include/x86_64-linux-gnu/c++/5
/usr/include/c++/5/backward
/usr/lib/gcc/x86_64-linux-gnu/5/include
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/5/include-fixed
/usr/include/x86_64-linux-gnu
/usr/include
End of search list.
# 1 "/dev/null"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 1 "<command-line>" 2
# 1 "/dev/null"
I have / mounted to drive letter Z, so my includePath looks like this:
"includePath": [
"z:\\usr\\include\\",
"z:\\usr\\include\\linux\\",
"z:\\usr\\include\\x86_64-linux-gnu\\",
"z:\\usr\\include\\x86_64-linux-gnu\\c++\\5\\",
"z:\\usr\\include\\x86_64-linux-gnu\\5\\include\\",
"z:\\usr\\include\\x86_64-linux-gnu\\5\\include-fixed\\",
"z:\\usr\\bin\\..\\lib\\gcc\\x86_64-linux-gnu\\5.4.0\\..\\..\\..\\..\\include\\c++\\5.4.0\\",
"z:\\usr\\bin\\..\\lib\\gcc\\x86_64-linux-gnu\\5.4.0\\..\\..\\..\\..\\include\\x86_64-linux-gnu\\c++\\5.4.0\\",
"z:\\usr\\bin\\..\\lib\\gcc\\x86_64-linux-gnu\\5.4.0\\..\\..\\..\\..\\include\\c++\\5.4.0\\backward\\",
"z:\\usr\\include\\c++\\5\\",
"z:\\usr\\include\\c++\\5\\backward\\",
"z:\\usr\\local\\include\\",
"z:\\path\\to\\my\\own\\includes\\"
],
As you can see, I have translated each path to the equivalent path on my Windows system. I can access the headers using these paths in Windows Explorer, so the path is correct. So even though I can open the iostream header by navigating to "z:\usr\include\x86_64-linux-gnu\c++\5\" and opening the file in any editor, VS code still shows a green squiggle below its include.
I am accessing the server over the internet, so I'm worried this might have something to do with VS code being unable to parse files that are slow to read. Is that likely to cause this problem? The fire icon in the bottom right does go away after a while (1-2 min).
Thanks for responding.
PS: Sorry for the inconsistent formatting.
Hello. As @smithalexk said above, the C++
extension doesn't work by default. But when I've added these 3 lines (see below) - all becomes working.
{
"includePath": [
// - 1st -
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include"
// ...
],
"defines": [],
"intelliSenseMode": "clang-x64",
"browse": {
"path": [
// - 2nd -
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/usr/include",
// ...
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
},
"macFrameworkPath": [
// - 3rd -
"/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk/System/Library/Frameworks",
"/System/Library/Frameworks",
"/Library/Frameworks"
]
}
Can you please make these changes to the plugin to make people on Mac happy? Thank you.
Hello , I'm having problems with #Includes when I'm coding in C, my c_cpp_properties.json:
{
"configurations": [{
"name": "Win32",
"intelliSenseMode": "clang-x64",
"includePath": [
"${workspaceRoot}",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include",
"C:\\MinGW\\include",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include-fixed"
],
"defines": [
"_DEBUG",
"UNICODE",
"__GNUC__=6",
"__cdecl=__attribute__((__cdecl__))"
],
"browse": {
"path": [
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include",
"C:\\MinGW\\lib\\gcc\\mingw32\\6.3.0\\include-fixed",
"C:\\MinGW\\include\\*"
],
"limitSymbolsToIncludedHeaders": true,
"databaseFilename": ""
}
}],
"version": 3
}
The error I've got:
My 'gcc -v -E -x c' output:
Using built-in specs.
COLLECT_GCC=C:\MinGW\bin\gcc.exe
Target: mingw32
Configured with: ../src/gcc-6.3.0/configure --build=x86_64-pc-linux-gnu --host=mingw32 --target=mingw32 --with-gmp=/mingw --with-mpfr --with-mpc=/mingw --with-isl=/mingw --prefix=/mingw --disable-win32-registry --with-arch=i586 --with-tune=generic --enable-languages=c,c++,objc,obj-c++,fortran,ada --with-pkgversion='MinGW.org GCC-6.3.0-1' --enable-static --enable-shared --enable-threads --with-dwarf2 --disable-sjlj-exceptions --enable-version-specific-runtime-libs --with-libiconv-prefix=/mingw --with-libintl-prefix=/mingw --enable-libstdcxx-debug --enable-libgomp --disable-libvtv --enable-nls
Thread model: win32
gcc version 6.3.0 (MinGW.org GCC-6.3.0-1)
COLLECT_GCC_OPTIONS='-v' '-E' '-mtune=generic' '-march=i586'
c:/mingw/bin/../libexec/gcc/mingw32/6.3.0/cc1.exe -E -quiet -v -iprefix c:\mingw\bin\../lib/gcc/mingw32/6.3.0/ - -mtune=generic -march=i586
ignoring nonexistent directory "c:\mingw\bin\../lib/gcc/mingw32/6.3.0/../../../../mingw32/include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include"
ignoring duplicate directory "/mingw/lib/gcc/mingw32/6.3.0/../../../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../include"
ignoring duplicate directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/include-fixed"
ignoring nonexistent directory "c:/mingw/lib/gcc/../../lib/gcc/mingw32/6.3.0/../../../../mingw32/include"
ignoring duplicate directory "/mingw/include"
#include "..." search starts here:
#include <...> search starts here:
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/../../../../include
c:\mingw\bin\../lib/gcc/mingw32/6.3.0/include-fixed
End of search list.
My "INCLUDE" files are in c:/MinGW/include/
Thank you!
@grigosback The 'stdio.h' file not found
message is not from our extension. Another user hit this same issue: https://github.com/Microsoft/vscode-cpptools/issues/1203 .
That was the problem @sean-mcmanus, I don't know why I had the C/C++ Clang Command Adapter, I uninstalled it and now I don't have that message anymore. Thanks a lot!
We recently updated the way the extension searches for default includes. This issue forked into a bunch of other issues so if we missed anything and you are still having problems, please open a new issue.
still does not work. but that is a way of running from it.
@andythedandyone, please open a new issue and we'll be happy to investigate.
@andythedandyone: kindly, go to settings.json and set "C_Cpp.intelliSenseEngine"
from "Default"
to
"Tag Parser"
Hello here ! I have the same problem but i use codeblocks in windows to compile. Help me please !
@Ladinstar Can you provide more repro info, preferably in a new issue: https://github.com/Microsoft/vscode-cpptools/issues/new .
thank you i have founded the solution !
Note to MacOS users, if you are using gcc
version 8.1.0 (for example) from Homebrew, your MacOS configuration should look like this:
{
"name": "Mac",
"browse": {
"path": [
"${workspaceRoot}"
],
"limitSymbolsToIncludedHeaders": true
},
"includePath": [
"${workspaceRoot}/**",
"/usr/local/Cellar/gcc/8.1.0/include/c++/8.1.0",
"/usr/local/Cellar/gcc/8.1.0/include/c++/8.1.0/x86_64-apple-darwin16.7.0"
],
"defines": [],
"compilerPath": "/usr/local/Cellar/gcc/8.1.0/bin/gcc-8",
"cStandard": "c11",
"cppStandard": "c++17",
"intelliSenseMode": "clang-x64"
}
Very simple. You do not need to include headers from XCode. Do not set compilerPath
to /usr/local/bin/gcc-8
, as this is a symbolic link that may mess up IntelliSense. If you are still having issues as I did, set the following user setting in settings.json
as others have to get around a recent issue: "C_Cpp.intelliSenseEngine": "Tag Parser",
What include files needed to run my code using cl.exe from MSVS 2015?
I've included these folders in c_cpp_properties.json:
"C:/Program Files (x86)/Windows Kits/8.1/Include/shared",
"D:/Program Files (x86)/Microsoft Visual Studio/2017Community/VC/include",
"D:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/*",
"D:/Program Files (x86)/Microsoft Visual Studio/2017/BuildTools/VC/Tools/MSVC/14.13.26128/include",
"D:/Program Files (x86)/Windows Kits/10/Include/10.0.10240.0/ucrt",
"D:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/include",
"D:/Program Files (x86)/Mirucrosoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/atlmfc/include",
"D:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/crt/src/x64",
But still I get an error while try to build:
> Executing task: & 'D:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.13.26128/bin/Hostx64/x64/cl.exe' 'h:\C++ Programs\ExBox01.cpp' <
Microsoft (R) C/C++ Optimizing Compiler Version 19.13.26128 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
ExBox01.cpp
h:\C++ Programs\ExBox01.cpp(2): fatal error C1034: iostream: no include path set
The terminal process terminated with exit code: 1
@adam-erickson There's a crashing bug with gcc 8.1 you may be hitting (https://github.com/Microsoft/vscode-cpptools/issues/2328 ) -- our latest insider release has the fix: https://github.com/Microsoft/vscode-cpptools/releases/tag/v0.17.8-insiders .
@prdas31 Our extension doesn't currently support any build features -- the c_cpp_properties.json is for the IntelliSense feature and not actual compiling. For building with MSVS 2015, you may need to build from the developer command prompt that ships with VS.
@prdas31 Our extension doesn't currently support any build features -- the c_cpp_properties.json is for the IntelliSense feature and not actual compiling. For building with MSVS 2015, you may need to build from the developer command prompt that ships with VS.
Thanks a lot for the clarification and suggestion. I now use build files to include the paths like this:
if exist "D:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" (
call "D:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Auxiliary\Build\vcvarsall.bat" x64
) else (
call "D:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" x64
)
This idea is taken from an VSCODE extension called Easy C/C++ Project.
Thanks.
[issue moved]
@leslienguyn, I moved your issue to #2582. This issue is closed.
Most helpful comment
What does gcc tell you the include path should be? Run this command and make sure all of the paths printed out are listed in your c_cpp_properties.json:
gcc -v -E -x c++ -