Got an "#include error" in C++

I wrote the following code in a main.cpp file in C++:

However, the first line “include ” tells me there is an “#include errors detected. Please update your includePath. Squiggles are disabled for this translation unit”. What should I do to fix this problem?

Hi, I am not sure whether you have solved this problem yet but I had the same problem. It looks like you are using Visual Studio Code which is what I use all the time.

Step1: - I assume that you have already installed the C/C++ Microsoft extension because IntellSense has picked up the #include error. I currently run a Windows 10 machine and have this installed: -

Step 2 : - If you hover your mouse over the squiggly line ‘Intellisense’ comes up with alternative solutions. Choose the ‘quick fix’.

Step 3 : - Once you have selected Quick Fix then you need to Edit “includePath” settings.

Step 4 : - Edit the IntelliSense Configuration. There are three settings, I do not thick the first one, Configuration name is critical, I have Win32: -

Step 5: - Compiler Path – this is critical. I have the g++ compiler installed on my Windows 10 machine. Visual Studio Code is just an Integrated Development Environment and it relies on an external compiler being installed. There is a lot of configuration information at the following website, [C++ programming with Visual Studio Code]

There is a drop down box with a number of options. I have the g++ compiler so chose that option.

Step 6 : - Depending on what you chose, there might be an error in the IntelliSense Mode: -

I selected the default: -
step 7
Step 7 : - Solved?? The squiggly line has gone.
step 8

There is a lot of information but I hope it helped,