I declared a function as
class CustomActor* Foo();
in other class.
However, the error keeps showing up as above.
Please let me know how to fix it.
thanks in advance.
I declared a function as
class CustomActor* Foo();
in other class.
However, the error keeps showing up as above.
Please let me know how to fix it.
thanks in advance.
I’d need to see more of your code to be sure, but either you probably multiple declarations of Foo (or whatever variable / method it’s compaining about).
Check your .h file to make sure you only use the variable / method names once.
#include “GameFramework/Pawn.h”
#include “Pawn.generated.h”
UCLASS()
class PROJ_API Pawn : public APawn{
...
class CustomActor* Foo();
...
}
--------------------------------
#include "Engine/StaticMeshActor.h"
#include "CustomActor.generated.h"
class PROJ_API CustomActor : public AstaticMeshActor{
...
AUsableActor(const class FObjectInitializer& PCIP);
...
}
Here it is
I’m assuming these are two .h files split into one. If not, you should certainly do that.
Other issues:
Fix up these issues and if it still doesn’t work, post the headers and error messages again.
Thank you so much!!
You saved my life
Glad it helped. Can you accept the answer to help others find it too.