VSCode include errors

Hi all, since I updated Unreal Engine to version 4.25 VS Code is having some problems finding the necessary includes. At least this affects the intellisense and therefore you probably wont get all possible IDE hints you should get.
If your error looks like this
2020-05-25 21_36_16-Window

(Sorry for the german part there).
If your error also shows “UBT_COMPILED_PLATFORM/UBT_COMPILED_PLATFORMPlatformCompilerPreSetup.h”
you might have the same error as me since this seems to be a bug in UE version 4.25.

You can check the issue tracker here
UE issue tracker
As you can see this issue seems to be already fixed and the fix should be shipped in UE Version 4.26

As for now I was able to fix the issue by mself by following what the first answer on the answerhub suggested
UE answerhub

Open Visual Studio Code and open the file /.vscode/c_cpp_properties.json
When scrolling down (after the huge list of includePath) you should see an empty array for defines

I basically went to the c_cpp_properties.json file of the building escape project and copied all entries in this files defines and pasted it into the defines of the simpleshooter project. Now replace the “BUILDING_ESCAPE” in the last two lines of the defines array with “SIMPLESHOOTER” and restart visual studio code.

Now the includes error should be gone

If you now get this error on your PlayerInputComponent

Add this include

#include "Components/InputComponent.h"
2 Likes

Yeah, this is annoying! Good sleth work. I want to record a video showing the workaround as a PSA.

1 Like

Creating a video to show all others the workaround is a nice idea :slight_smile:

1 Like


Hi, I faced the same issue as yours and used the same workaround you suggested. But upon adding a new class, the intellisense started worrying about the colon symbol used for inheritance(screen-shot attached).
Did you come across this as well?

P.S. For the Build cs file, it’s not complaining(screenshot below)

P.P.S Also, there are a lot more squiggles in the cpp file associated with the class

Try this https://www.gamedev.tv/courses/unreal-engine-c-developer-4-22-learn-c-and-make-video-games/lectures/17467871

1 Like

Worked! Thank you!

This kind of worked for me.
But now I get red squiggles under “UE_LOG” with the error “expected a member name C/C++(133)”.
This does not happen with empty defines.
I don’t know if there are more bugs. My project is farily empty.

Edit: Never mind. I’m a dumbass. I had a typo in the line before.

I got the work around. it currently works on Mac version of Unreal engine .

Privacy & Terms