Unresolved external symbol with FWheelSetup

Despite being very inexperienced with C++ and programming in general, I’ve been attempting to create a modified version of WheeledVehicleMovementComponent4W set up to use PxVehicleDriveTank instead of PxVehicleDrive4W.

At any rate, the problem I’m running into currently is this error when I attempt to compile:

error LNK2019: unresolved external symbol "public: __cdecl FWheelSetup::FWheelSetup(void)" (??0FWheelSetup@@QEAA@XZ) referenced in function "void __cdecl DefaultConstructItems<struct FWheelSetup>(void *,int)" (??$DefaultConstructItems@UFWheelSetup@@@@YAXPEAXH@Z)

I have #include “Vehicles/WheeledVehicleMovementComponent.h” in my header file just as it is in WheeledVehicleMovementComponent4W.h so I’m not sure why it’s having an issue with using FWheelSetup. The code that uses FWheelSetup hasn’t changed in my modified class. Is there an additional step I need to do when including a file in a custom class? Keep in mind I mostly have no idea what I’m doing so I’m likely just missing something really simple.

Hi,

This is happening because we didn’t mark FWheelSetup with ENGINE_API. The result is that the struct is not exported in the DLL so the compiler doesn’t know where to find the actual implementation.

Try adding ENGINE_API to FWheelSetup like this:

struct ENGINE_API FWheelSetup

Let me know if you’re still stuck after that.

Hmm, added ENGINE_API to FWheelSetup, now it’s giving me this error:
error C2487: ‘StaticStruct’ : member of dll interface class may not be declared with dll interface

Alright, still may be doing something crazy wrong, but I’ve made this declaration in my class

struct ENGINE_API FWheelSetup;

still get this linker error:

error LNK2019: unresolved external symbol “public: __cdecl FWheelSetup::FWheelSetup(void)” (??0FWheelSetup@@QEAA@XZ) referenced in function “void __cdecl DefaultConstructItems(void *,int)” (??$DefaultConstructItems@UFWheelSetup@@@@YAXPEAXH@Z)

so either way I do it seems to pop up an error.

still stuck :confused: