Error: C2084 Already has a body
I am trying to spawn in a blueprint via c++. And I have a problem with the class. When I compile it says that AA_MainGame::AA_MainGame(const class FObjectInitializer& PCIP) already has a body. I read somewhere that this means that I've probably included the file to much. I've read this post on stackoverflow: http://stackoverflow.com/questions/21080453/error-c2084-function-already-has-a-body and the article about header guards, and I do understand the concept but I do not know how to apply it to my own code.
I hope you can help me out :)
Thanks in advance,
asked Jan 03 '15 at 06:12 PM in C++ Programming
The Problem here is that the 'GENERATED_BODY()' Macro aleready declares and defines 'AA_MainGame(const class FObjectInitializer& PCIP)' for you, so when you define it in your *.cpp you have two Definitions.
But the Macro does not declare & define the Constructor if you declare it yourself, so you have to add 'AA_MainGame(const class FObjectInitializer& PCIP);' in your header and it should work.
answered Jan 03 '15 at 06:25 PM
For me help changing GENERATED_BODY() by GENERATED_UCLASS_BODY()
answered Nov 19 '18 at 05:28 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here