I added a C++ class to my Blueprint project and then the nightmares began. I am using VS Studio Enterprise 2015 update 3 & Windows 7 64.
Now it won’t even open the project because it says “Missing Project Modules” - “The following modules are missing or built with a different engine version: Would you like to rebuild them now?”
If you say No, it just shuts down, if you say Yes, it shows “Error - Project could not be compiled. Try rebuilding from source manually.”
Right click on the .uproject select, Generate visual studio files , then open visual studio, and if it still has problem with windows.h, then i don’t know. best of luck.
Tried that, doesn’t work. Says “This project does not have any source code. You need to add C++ source files to the project from the Editor before you can generate project files.”
My C++ code had some problems and was stopping the editor from launching my project. I thought that if the custom C++ code has bugs, then UE4 will not show my C++ classes in the Editor, or not compile the c++ classes at all, but in Unreal’s case, the editor will not launch the project at all if the C++ code is buggy. This is one of the very scary quirks of UE. I can suggest a temporary workaround and it worked for me. See if this works for you.
Here is the temporary workaround:
Save a copy of your YourProject.uproject file somewhere safe before proceeding.
In the YourProject.uproject config file, look for the section named ‘Modules’. Here is the pic of a sample .uproject
Under the ‘Modules’ section, remove any mention of your C++ project from the “Modules” section. Here is the pc showing your c++ project removed from the Modules section:
Move your c++ project folder from under Sources folder to some other folder outside your UE project.
Now try starting your project.
Since your C++ project references have been removed from YourProject.uproject, UE4 will not try building your C++ project and will launch your project without your c++ classes.
This works for me. However, please note that I did not have much code and it was easy for me create a new c++ class from the UE4 editor and proceed with the compilation. The main problem is figuring out the dependencies.
Your build.cs files for your project, this is where you mention your dependencies.
Your entire build error log, whatever you mentioned is insufficient.
When I am building for a specific platform like windows, I make sure that the windows specific includes are mentioned between PLATFORM_WINDOWS like this: #if PLATFORM_WINDOWS #include “Windows/WindowsSystemIncludes.h” #endif
I have just tried this solution in Unreal Engine 5 and it managed to make my project launch again.
Unfortunately, it appears to have also corrupted it beyond repair. I reloaded the editor and actors such as health packs and enemies I’ve placed down have disappeared, and the Live Coding button is nowhere to be seen, preventing me from compiling.
When I try to click the play button, the editor gives me a warning stating that my Gamemode file is corrupted.
I may have done something wrong or this solution may not be compatible with Unreal Engine 5. Overall, I would recommend backing up the whole project and exercising some caution before performing this.