2

I'm trying to run this code that I found online to figure out how to run C++ on Visual Studio Code but it keeps telling me "Please update your includePath. IntelliSense features for this translation unit... will be provided by the Tag Parser." as well as "could not open source file "iostream" (no directories in search list)". VC told me to download git and so I did. Its site also told me to download mingw-w64 and I did so. How do I edit includePath settings? Please keep in mind that I am a complete beginner to C++ but need to be able to use something for a class and was recommended VC.

#include <iostream>
int main()
{
    std::cout << "Hello World!";
    std::cout << std::endl;
    return 0'
}
eisbehr
  • 12,243
  • 7
  • 38
  • 63
M. A.
  • 31
  • 1
  • 1
  • 2

3 Answers3

0

From your question, it looks like you are following the Getting Started with C++ VSCode tutorial. But something isn't working and you're getting the "Please update your includePath" error message, which is basically VSCode's way of saying "I am confused".

My guess is the compiler path is not set right in the C/C++ settings. Double-check the path you have entered there.

In any case, I have written up generic instructions on troubleshooting this error message in this answer to a similar question.

Scott McPeak
  • 8,803
  • 2
  • 40
  • 79
0

I solved this by adding the enclosing folder to my VSCode C++ Include Path:

First you need to install the C/C++ extensions (I think this is required, doesn't hurt to install it either way!).

c/c++ extension for vscode by Microsoft

Then go to File > Preferences > Settings

Search for C++ include path and you'll see this:

enter image description here

Click on the link to "Edit in settings.json" and update "C_Cpp.default.includePath" by adding your path to the array. For me, the header files were located at

C:\\Program Files\\Epic Games\\Engine\\Source\\Runtime\\Core\\Public

enter image description here

Adding this resolved the issue for me; all of the UE4 headers are able to be "intellisensed". This could also have been added to the C_Cpp.default.systemIncludePath array the the same effect.

~Cheers~

Mostly_Yoshi
  • 93
  • 10
  • Please, don't use pictures that show text. The pictures are hard to read at some devices. The text is easily copied to the clipboard and further to your web browser. – harper Apr 02 '22 at 15:27
-1

If you're using different partitions or drives for your projects, i recommend you to change to Visual Studio cause it includes an IDE, more tools for more specific projects, and it's the best choice for beginners.