Why I cannot call this physX function?

I made a new C++ driving template project. I’ve been trying to replace the template content with my own.

The template includes UWheeledVehicleMovementComponent4W (wheeledvehiclemovementcomponent4w.cpp -.h) which calls the “PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs” in UpdateSimulation() and from the PhysXPublic.h library. I am trying to make my own vehicle movement class which for now is almost identical to the template one’s, except I get this build error:

unresolved external symbol "void __cdecl physx::PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs(struct physx::PxVehiclePadSmoothingData const &,class physx::PxFixedSizeLookupTable<8> const &,class physx::PxVehicleDrive4WRawInputData const &,float,bool,class physx::PxVehicleDrive4W &)" (?PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs@physx@@YAXAEBUPxVehiclePadSmoothingData@1@AEBV?$PxFixedSizeLookupTable@$07@1@AEBVPxVehicleDrive4WRawInputData@1@M_NAEAVPxVehicleDrive4W@1@@Z) referenced in function "public: void __cdecl ::operator()(struct FPhysicsActorHandle_PhysX const &)const " (??R@@QEBAXAEBUFPhysicsActorHandle_PhysX@@@Z)

#includes are the same and #if WITH_PHYSX… is the same… everything seem to be identical to template code.

If I replace my movement class with the template’s UWheeledVehicleMovementComponent4W everything works fine. I cannot find the definition for “PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs” anywhere. I tried looking in engine source and project folders. I should mention that I’m not very familiar with C++.

Where is the physX function “PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs” defined?
Why can’t I call it from my movement class?

void UMyVehicleMovement::UpdateSimulation(float DeltaTime)

        PxVehiclePadSmoothingData SmoothData = {
            { ThrottleInputRate.RiseRate, BrakeInputRate.RiseRate, HandbrakeInputRate.RiseRate, SteeringInputRate.RiseRate, SteeringInputRate.RiseRate },
            { ThrottleInputRate.FallRate, BrakeInputRate.FallRate, HandbrakeInputRate.FallRate, SteeringInputRate.FallRate, SteeringInputRate.FallRate }

        PxVehicleDrive4W* PVehicleDrive4W = (PxVehicleDrive4W*)PVehicleDrive;
        PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs(SmoothData, SpeedSteerLookup, RawInputData, DeltaTime, false, *PVehicleDrive4W);

Yeah I have. I think because the template movement class works in my vehicle class all the proper modules should be added anyway.

Have you added the necessary modules to your code? For example: PhysXVehicles module.

Woah it’s working! Btw where did you check I needed “PhysXVehicleLib” or did you just deduced “PhysXVehicle + Lib”?


If you make your comment as answer I will mark it as correct.

Its body might be defined in a dll. Have you tried including “PhysXVehicleLib” module in public dependencies?

You’re welcome. Glad to be of help.
I checked “PhysXVehicles.Build.cs” in PhysXVehicles plugin.

As PxVehicleDrive4WSmoothAnalogRawInputsAndSetAnalogInputs() had no body, it was safe to assume it’s been defined in a dll.