I'm still getting red squiggles in VSCode but it compiles

Changing #include "Pawns/PawnBase.h" to #include "PawnBase.h" does allow me to compile but it causes Intellisense to complain which is really annoying because sometimes it doesn’t autocomplete and also I can never be sure if I did something wrong or not.
It underlines all 3 includes in PawnTank.h and #include PawnTank.h in PawnTank.cpp.
That makes no sense to me. How can PawnTank.cpp not even find its own header?

So, any ideas what causes this or how to fix it?

Sound like the 4.25 defines bug. Go into your IDE, .vscode folder, open c_cpp_properties.json, expand the defines section. If the defines section is essentially empty you’ll need to dig through Bulls and Cows resources (I do not remember which number) and get a copy of the defines.txt file. Copy the defines.txt contents into your .json defines section. At the bottom of the defines section will be a line for the project path, edit that line to your project path.

Even with the defines entered I still get errors

I already did that. Before that pretty much everything was red. Now it’s just the PawnTank.h and PawnTank.cpp.

Edit: So I just copied the defines attached to lesson 43 “4.25 VSCode Intellisense Bug” and now it’s working properly. There must have been something wrong with the defines list I copied earlier.

1 Like

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms