Using Visual Studio Code With Unreal Engine 4.24

Hello Everyone,
I’m currently trying to use Visual Studio Code with Unreal Engine and while I was able to switch the source preferences inside Unreal Engine and get the files to open Visual Studio itself, I’m having an issue with pathing. So, I usually start projects as a blueprint project, to avoid having some of the automatically generated c++ code that comes with starting a new c++ project, and when I add a new c++ class and select to put my headers in the public folder and my cpps in the private folder, Visual Studio code is unable to open the include files in my cpps, which are my headers. I’ve tried looking up tutorials but they’re pretty outdated and none have been able to solve my issue. The quick fix that I did was to move my headers to the private folders with my cpp files but that defeats the entire purpose of the separation. I have to add the idea of having the header files in a public folder and the cpps in the private folder is done by Unreal not by me.

Do you get a compilation error with them in Public? Did you try refreshing the workspace?

I have not tried refreshing the workspace, so I’ll will try that. Also I haven’t move the .cpp to the public section but i’m assuming it works. But, that defeats the purpose of the private and public sections that Unreal Engine creates.

If you’re making a game then I would assume you aren’t going to be using this code in another module so there isn’t exactly any benefit from separating them like that IMO.

Privacy & Terms