I’ve encountered a persistent issue where my C++ project fails to build if I make any changes to certain custom C++ files (make no changes will successfully build and run), even something as minor as adding a whitespace or a new blank line. Additionally, the build fails if I change the encoding of these custom C++ files from GBK to UTF-8.
Here are the steps I’ve tried to resolve the issue:
Cleaned and rebuild the solution
Regenerated Visual Studio project files
Attempted to build using both Visual Studio 2022 and Rider
rollback or revert to previous version
Despite these efforts, the build continues to fail under the conditions mentioned above. Has anyone experienced similar issues or have any suggestions on how to resolve this?
I just find what causes the issue but I do not understand what is behind the issue.
I have some code in old versions like:
TSubclassOf<GameplayAbility> StartupAbilities
or
TArray<FActiveGameplayEffectHandle> ActiveEffects
But I never include “Abilities/GameplayAbility.h” or “ActiveGameplayEffectHandle.h” and I can still build successfully and run the project with old version. Now I have upgrade UE from 5.3.2 to 5.4.2 I got error like:
I am stupid because I never thought it just because I need include some .h file. I don’t understand what’s happening here, could you please briefly explain this to me?
By the way I don’t know why my output has Chinese, I want to change the output to English.
I did not add “Abilities/GameplayAbility.h” or “ActiveGameplayEffectHandle.h” to my files, that is the reason I build fail on my current version. But the real question is my previous version also does not include “Abilities/GameplayAbility.h” or “ActiveGameplayEffectHandle.h”, but it will just build successfully.