Link error when creating a component inheriting from USphereComponent

Here is the trick:

  1. Remove the keyword MinimalApi from the UCLASS macro above UShapeComponent and USphereComponent
  2. Put ENGINE_API between the keyword class and the UShapeComponent and USphereComponent name
  3. Remove all ENGINE_API from the functions in the headers of UShapeComponent and USphereComponent

Here are what the declarations of UShapeComponent and USphereComponent should now look like:

UCLASS(HeaderGroup=Component, ClassGroup=Shapes, editinlinenew, hidecategories=(Object,LOD,Lighting,TextureStreaming), meta=(BlueprintSpawnableComponent))
class ENGINE_API USphereComponent : public UShapeComponent
{
    // ...
};

UCLASS(abstract, HeaderGroup=Component, hidecategories=(Object,LOD,Lighting,TextureStreaming,Activation,"Components|Activation"), editinlinenew, meta=(BlueprintSpawnableComponent), showcategories=(Mobility))
class ENGINE_API UShapeComponent : public UPrimitiveComponent
{
    // ...
};