Compiling within the editor complains about changes to generated files

VS 2013 Win7 x64. My project has been compiling fine within the editor until today, when it started complaining about changes to generated files. As usual, when this happens, I close the Editor, clean the solution, and rebuild in VS. However, no matter what I try, when I go back to compile within the Editor, the error will no longer go away. I have tried deleting the Intermediate directory as well, to no avail.

Recompiling MyProject5…
Launching UnrealBuildTool… [C:/Program Files/Unreal Engine/4.0/Engine/Binaries/DotNET/UnrealBuildTool.exe MyProject5 -ModuleWithSuffix MyProject5 1211 Win64 Development -editorrecompile -FailIfGeneratedCodeChanges “C:/dev/Unreal/Projects/MyProject5/MyProject5.uproject” -rocket -rocket]
Warning: Starting HotReload took 0.0s.
LogMainFrame: MainFrame: Module compiling took 3.075 seconds
CompilerResultsLog: New page: Compilation - Apr 6, 2014, 9:48:01 AM
CompilerResultsLog: Info Parsing headers for MyProject5
CompilerResultsLog: Info ERROR: ‘C:/dev/Unreal/Projects/MyProject5/Intermediate/Build/Win64/Inc/MyProject5/GeneratedMeshComponent.generated.h’: Changes to generated code are not allowed - conflicts written to ‘C:/dev/Unreal/Projects/MyProject5/Intermediate/Build/Win64/Inc/MyProject5/GeneratedMeshComponent.generated.h.conflict’
CompilerResultsLog: Info Error: Failed to generate code for MyProject5
CompilerResultsLog: Info ERROR: UnrealHeaderTool failed for target ‘MyProject5’ (platform: Win64, module info: C:\dev\Unreal\Projects\MyProject5\Intermediate\Build\Win64\MyProject5\Development\UnrealHeaderTool.manifest).
Warning: HotReload failed, recompile failed

Hi dmacesic,

Does this only occur within your project or has this occurred in a clean project on a blank/default level? Thank you!

This only occurs in my project. I created a blank project, added a custom class, and I did not get the error. I had a bunch of different ones (unresolved externals) when changing to Development from Development Editor in the blank project, but no error about the generated files.

Solved it, finally. I right-clicked the .uproject file in my project folder, and selected “Generate Visual Files”. I then opened the project, changed the configuration to Development/x64, and it no longer complained about the generated file.

I spoke too soon. It worked for a few compiles, but then the error message came back. Is there any way to completely clean a project? VS Clean Solution doesn’t seem to delete everything.

Hi,

Could you post the two files listed in the output, please:

C:/dev/Unreal/Projects/MyProject5/Intermediate/Build/Win64/Inc/MyProject5/GeneratedMeshComponent.generated.h
C:/dev/Unreal/Projects/MyProject5/Intermediate/Build/Win64/Inc/MyProject5/GeneratedMeshComponent.generated.h.conflict

This will better allow us to diagnose the problem.

Thanks,

Steve

Here you go link textlink text

Thanks! But those two files are binary-identical, so there shouldn’t be any conflict at all.

I wasn’t clear before so I apologise: I need a copy of those files at the point you see the error. If you stop the editor and do a normal VC compile then the first file will be overwritten and there will be no more conflict.

If you get the error again, could you repost those files here before doing anything else, please?

Thanks,

Steve

I repeated the procedure and again made extra sure that the files I am including occur at the point I see the error. They are attached.

I however noticed something, the error message in the editor says:

CompilerResultsLog: Info ERROR: ‘C:/dev/Unreal/Projects/MyProject5/Intermediate/Build/Win64/Inc/MyProject5/GeneratedMeshComponent.generated.h’: Changes to generated code are not allowed - conflicts written to ‘C:/dev/Unreal/Projects/MyProject5/Intermediate/Build/Win64/Inc/MyProject5/GeneratedMeshComponent.generated.h.conflict’

However, I found the GeneratedMeshComponent.generated.h file in C:\dev\Unreal\Projects\MyProject5\Intermediate\Build\Win64\MyProject5\Inc\MyProject5 instead (the last part of the path is different). I am using Development/x86 as configuration

link text
link text

Here is the screenie for the error

And here is a short movie showing the contents of the Intermediate directory. The generated files seem to go to a different place than the conflict file.

Well, that’ll certainly be an issue. :slight_smile: The tool believes there’s a conflict because the file doesn’t even exist in the location that it thinks it does.

I’ll look into this and get back to you. It’s a little strange that you’ve found it to be intermittent though (‘it worked for a few compiles’).

Steve

Could it be the result of switching configurations? I notice that the default projects use “Development Editor/Windows”, and I switch to “Development/x64”. Sometimes after having done a first compilation. Maybe one of the configurations has an error?

Yes, I would say there’s something suspect there. Our generated solution shouldn’t contain any solution platforms named ‘x64’, so I’m not sure how you’ve ended up with that. Have you perhaps added a third-party project to the solution?

A non-editor build can certainly cause your .generated.h files to be written out in the location you ended up finding it in. Yet you shouldn’t be able to run the editor in a non-editor build like ‘Development’ (should be ‘Development Editor’).

It looks like something has got entirely confused. I can only suggest deleting your project’s Intermediate folder, regenerating the solution/projects and trying again. And sticking to the Development Editor/Win64 configuration if you want to run the editor. I’m still not sure how you managed to get Development/x64.

Post back here if you continue to have problems.

Steve

Ok that resolved it, I went back to the default “Development Editor/Windows” configuration. The “x64” configuration was inspired by this documentation page: https://docs.unrealengine.com/latest/INT/Programming/QuickStart/6/index.html

I couldn’t see Win64 in my list, but x64 was there, so I chose that.

This has been a problem since the release.

As soon as you start adding custom classes to your project, every compile will yield that error and you can only compile in VS, and you can’t package the project.

Doesn’t matter whether it’s from GitHub or not, or how many projects you make. Eventually, after creating a few classes you’re gonna get this error every time. It’s really annoying.

I have 20 projects for testing, simply because at some point it’s no longer possible to compile, and you need to create a new project.

And if you don’t get that error, you get an error that it can’t find the .generated.h include files, even though you can right click the include directive and “Go to header”, and it opens just fine.

Has this been resolved yet?
I am experiencing a similar problem.

With a custom class added and successfully build from VS, I made a tiny change and recompiled the C++ code in the editor, and it failed for the same error as aforementioned (changes not allowed in generated files). I removed the .conflict file and launched a build in VS. No dice, it failed with a bunch of errors. I launched another build in the editor, and it completed “successfully.” Upon reviewing the blueprint of the class in question, the default parameter that I had changed to do this test, had not changed. I removed the blueprint, recompiled in editor (successful) and re-created the blueprint, and it still had not changed.

It seems that the recompile in game feature is breaking the VS build somehow, but after continuous in editor rebuilds, it states that it recompiled successfully but it really didn’t do anything.

Please let me know what a suggested course of action might be, or if you need more information. I could also create another thread if desired.

Thanks,

Yes, there’s a marked answer just above… Essentially, you must keep it in the “Development Editor/Windows” configuration in VS. If you did something else like delete random files, then you may have broken something. In that case, to reset your project, you can delete the Binaries and Intermediate directories under you project, and right-click the .uproject file and select “Generate Visual project files”. HTH

Switching from “Debug Editor/Win64” to “Development Editor/Win64” works.

Note: make sure you’re only modifying code inside .cpp functions, and changes to configurable values for existing blueprints are ignored until next editor restart.

This worked for me.