When I move the UTankAimingComponent() constructor to private:, I get these compile erros:
CompilerResultsLog:Error: Error Tank.cpp.obj : error LNK2019: unresolved external symbol "private: __cdecl UTankAimingComponent::UTankAimingComponent(void)" (??0UTankAimingComponent@@AEAA@XZ) referenced in function "public: static void __cdecl UTankAimingComponent::__DefaultConstructor(class FObjectInitializer const &)" (?__DefaultConstructor@UTankAimingComponent@@SAXAEBVFObjectInitializer@@@Z)
CompilerResultsLog:Error: Error TankAimingComponent.cpp.obj : error LNK2001: unresolved external symbol "private: __cdecl UTankAimingComponent::UTankAimingComponent(void)" (??0UTankAimingComponent@@AEAA@XZ)
CompilerResultsLog:Error: Error BattleTank.generated.cpp.obj : error LNK2001: unresolved external symbol "private: __cdecl UTankAimingComponent::UTankAimingComponent(void)" (??0UTankAimingComponent@@AEAA@XZ)
But if I comment the constructor out completely, the code compiles fine.
Similarly, I tried to create a constructor in the TankMovementComponent, but kept getting similar errors, so I compiled without a constructor.
What could be causing this? (I’m using UE version 4.12.5.)