VSCode cannot open source file

I’ve opened up VSCode for the first time using Unreal for the BullCowGame and have got loads of errors within the #include functions. the errors sem to be telling me that they cannot open source file “UBT_COMPILED_PLATFORM/UBT_COMPILED_PLATFORMPlatformCompilerPreSetup.h” (dependency of “CoreMinimal.h”). I have no Idea what this means. Seen some posts saying they have had similar expreiences but I tried refreshing VSCode project in Unreal but the errors still seem to be popping up. Would really appreciate some help.

Thanks

See the lecture titled “4.25 VS Code Bug” (paraphrased)

Where would I find this lecture? I don’t seem to be able to see it on the Udemy Course.

Thanks!

In section 1.

Brilliant, thank you very much! It still says there is an error "cannot open source file “sal.h” but the intellisense seems to be working now!

Could you show the .h?

I’m not sure how to do that, should it be somewhere in my source files?

Well I was asking for BullCowCartridge.h which you can get to in your explorer on the left. But could you also include your CoreMinimal.h? You can do that by control clicking the include

Ah right, thanks. I have opened both and got these results. As I open up coreminimal.h I can see there are now a bunch more files that VSCode can’t open haha. I really appreciate the help with this

After some exploring I have discovered that as far as I can tell is that VSCode cannot open a file called “tchar.h” Which seems to be a dependency of every .h file that I open in the core folder. I can’t actually locate this file so far so maybe that’s the issue?

Are you able to compile?

Yes I am, In Unreal I can’t really see any issues so far. Not sure if this actually is an issue as like I said the Intellisense seems to be working butthe squiggles remain firmly in place

Oh right, I’m just realising you’re not on Windows. Some of the defines are platform specific and the defines given are for Windows so you’d be missing macOS defines.

Ah right! I’m sorry I should have made that clear right at the start! Apologies

Is the problem that the defines.txt is for Windows?

Most likely.

Is there a version of the defines.txt for MacOS? Or should I just continue with it the way it is?

I can’t find the thread of someone providing it but if you’re able to get 4.24 you can create a C++ project from that and then copy the defines over to your 4.25

thanks very much. I really appreciate the help!

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