I have the following two files:
#pragma once
#include "Components/SphereComponent.h"
#include "BallSphereComponent.generated.h"
/**
* The ball's spherical collision component. The ball gets modelled as a perfect sphere regarding collision.
*/
UCLASS()
class UBallSphereComponent : public USphereComponent
{
GENERATED_UCLASS_BODY()
};
and
#include "MyGame.h"
#include "BallSphereComponent.h"
UBallSphereComponent::UBallSphereComponent(const class FPostConstructInitializeProperties& PCIP)
: Super(PCIP)
{
}
Which give me the following linking errors:
BallSphereComponent.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UShapeComponent::GetUsedMaterials(class TArray<class UMaterialInterface *,class FDefaultAllocator> &)const " (?GetUsedMaterials@UShapeComponent@@UEBAXAEAV?$TArray@PEAVUMaterialInterface@@VFDefaultAllocator@@@@@Z)
BallSphereComponent.cpp.obj : error LNK2001: unresolved external symbol "public: virtual class UBodySetup * __cdecl UShapeComponent::GetBodySetup(void)" (?GetBodySetup@UShapeComponent@@UEAAPEAVUBodySetup@@XZ)
BallSphereComponent.cpp.obj : error LNK2001: unresolved external symbol "public: virtual void __cdecl UShapeComponent::PostEditChangeProperty(struct FPropertyChangedEvent &)" (?PostEditChangeProperty@UShapeComponent@@UEAAXAEAUFPropertyChangedEvent@@@Z)
Inheriting from any other component works fine. This is in UE 4.2, and apparantly these linking errors should have been fixed? I only found one other post with this problem, but that wasof no help at all.