I know two things for sure:
- It is not reproducible in a new project
- It has to do with creating a new makefile for project, as simply building rather than rebuilding does not cause the issue.
This all began after I created UI classes. I have two AHud classes and two UUserWidget classes. The initial classes compile and work.
Here’s where it gets odd. It appears I’ve run into a limit on USpecifiers. From the last successful compilation I had, I can only add 1 new USpecifier, be it UCLASS(), UFUNCTION(), or UPROPERTY(), after that any additional USpecifiers + a rebuild will result in a compilation error where it states all my forward declarations "use of undefined type ‘ACharacter’ ", be it engine or custom class. As I fix one another pops up.
The only other error I see is a persistent circular dependency error for DataContainers.h, which the project will compile with and has been present since near the beginning. DataContainers.h only includes Globals.h and Data.h. Globals.h includes Data.h. Data.h does not inherit any custom classes.
At this point, I’m stuck and can’t move my project forward until I solve why this issue is occuring.
Here is a normal compilation of actions:
1>Building 6 actions with 6 processes...
1> [1/6] SharedPCH.Engine.ShadowErrors.cpp
1> [2/6] Module.Test.gen.cpp
1> [3/6] Module.Test.cpp
1> [4/6] UE4Editor-Test.lib
1> Creating library E:\Anvil-Root\Test\Intermediate\Build\Win64\UE4Editor\Development\Test\UE4Editor-Test.lib and object E:\Anvil-Root\Test\Intermediate\Build\Win64\UE4Editor\Development\Test\UE4Editor-Test.exp
1> [5/6] UE4Editor-Test.dll
1> Creating library E:\Anvil-Root\Test\Intermediate\Build\Win64\UE4Editor\Development\Test\UE4Editor-Test.suppressed.lib and object E:\Anvil-Root\Test\Intermediate\Build\Win64\UE4Editor\Development\Test\UE4Editor-Test.suppressed.exp
1> [6/6] TestEditor.target
1>Total time in Parallel executor: 34.37 seconds
Here is the error compilation of actions:
1>Building 7 actions with 6 processes...
1> [1/7] SharedPCH.Engine.ShadowErrors.cpp
1> [2/7] Module.Test.gen.2_of_2.cpp
1> [3/7] Module.Test.gen.1_of_2.cpp
1> [4/7] Module.Test.cpp
1>Done building project "Test.vcxproj" -- FAILED.
I removed the errors because there’s a wall of them all centering around forward declarations.
Here is a nearly identical issue that seems unresolved
I attempted to build without unitybuild, but the result was the same.