Closed StenBone closed 9 years ago
I changed the constructor, but still got the same error.
ABrickGrid::ABrickGrid(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
PrimaryActorTick.bCanEverTick = true;
BrickGridComp = PCIP.CreateDefaultSubobject<UBrickGridComponent>(this, TEXT("BrickGridComp"));
}
I am really confused as to what is wrong.
I think this is a case of the UBrickGridComponent definition missing the BRICKGRID_API qualifier. Try changing it to this: class BRICKGRID_API UBrickGridComponent : public USceneComponent Let me know if that works and I'll make the change in the master branch.
Your instructions worked @AndrewScheidecker! I was beginning to think that I would never sort out that bug.
I put BRICKGRID_API in the right place just as you demonstrated in your reply above and removed BRICKGRID_API from the method declarations within the UBrickGridComponent class declaration in the header and now it works perfectly.
Thank you for the help @AndrewScheidecker and happy new year!
I am trying to use UBrickGridComponent in my BrickGrid class which is based off of the BrickGrid blueprint.
In my header:
In the constructor of my source file:
The project builds the header properly, but throws an error when trying to run the source file. I have other components in my project which compile fine, when using similar syntax. What do you think is the problem? Is there another way to initialize this component?
Error Message:
error LNK2019: unresolved external symbol "private: static class UClass * cdecl UBrickGridComponent::GetPrivateStaticClass(wchar_t const *)" (?GetPrivateStaticClass@UBrickGridComponent@@CAPEAVUClass@@PEB_W@Z) referenced in function "private: cdecl ABrickGrid::ABrickGrid(class FObjectInitializer const &)" (??0ABrickGrid@@AEAA@AEBVFObjectInitializer@@@Z) C:\Users\Ben\Desktop\BrickGame-master\BrickGame-master\Intermediate\ProjectFiles\BrickGrid.cpp.obj