I am doing the Unreal Engine C++ Developer: Learn C++ and Make Video Games Course. During lecture 89, I have to setup a new Unreal Engine project: Building_Escape.
After setting up the VS code through UE, my VS code seemed fine.
Then I added a component to the sphere, as per the lessons instructions. This caused the new WorldPosition.h and WorldPosition.cpp as well as the other source code to give errors.
I am getting #include errors. See image below:
I have searched online for solutions, however they do not seem to apply:
**1. Solution 1 **
Copy in the define code from UE2.4 into the c_cpp_properties.json of VS code. Solution 1 response
My .json does not contain the define section to paste in the indicated code.
**2. Solution 2 **
Ensure Unreal Engine is using VS Studio Code as compiler of preference.
**2. Solution 2 response **
I verified that it does. (I also refreshed it).
3. Solution 3
Use Windows in order to make use of the VS Studio Code intellisense and .json setup. 3. Solution 3
I am using Windows 10.
Unreal doesn’t automatically refresh the compileCommands when adding a new class. You can do that manually by doing File > Refresh VS Code project within Unreal.
Firstly, thank you for your quick response.
I have refreshed VS Studio Code via unreal multiple times.
When I do this, all the errors disappear for a few seconds and then just return with the same #include error and red squiggles everywhere.
Unfortunately it does not seem to fix my problem.
I downloaded, installed and enabled the extension as per the instructions.
I then restarted VS code, but the errors are still there.
I then closed VS code again. Located my Building_Escape.uproject and selected Generate Visual Studio Project Files. I also refreshed my visual studio project through unreal engine, unfortunately nothing has worked.