# Why I cannot call this physX function?

**URL:** <https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842>\
**Category:** World Creation\
**Tags:** physx, template-project, unresolved-external-, unreal-engine, Physics, UE4, question, CPP\
**Created:** [May 26, 2020, 5:53pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842 "2020-05-26T17:53:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_c5e8012d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c5e8012d](https://forums.unrealengine.com/u/anonymous_user_c5e8012d)\
**Post date:** [May 26, 2020, 5:53pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/1 "2020-05-26T17:53:20Z")

</div>

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);
    });
}

```

---

<div class="post-metadata">

**Author:** ![Ali\_TeamRevived](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ali_teamrevived/32/623450_2.png) [@Ali\_TeamRevived](https://forums.unrealengine.com/u/Ali_TeamRevived)\
**Post date:** [May 26, 2020, 7:03pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/2 "2020-05-26T19:03:23Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c5e8012d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c5e8012d](https://forums.unrealengine.com/u/anonymous_user_c5e8012d)\
**Post date:** [May 26, 2020, 7:15pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/3 "2020-05-26T19:15:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ali\_TeamRevived](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ali_teamrevived/32/623450_2.png) [@Ali\_TeamRevived](https://forums.unrealengine.com/u/Ali_TeamRevived)\
**Post date:** [May 26, 2020, 7:28pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/4 "2020-05-26T19:28:51Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c5e8012d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c5e8012d](https://forums.unrealengine.com/u/anonymous_user_c5e8012d)\
**Post date:** [May 26, 2020, 7:41pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/5 "2020-05-26T19:41:49Z")

</div>

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

Thanks

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_c5e8012d](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_c5e8012d](https://forums.unrealengine.com/u/anonymous_user_c5e8012d)\
**Post date:** [May 26, 2020, 7:42pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/6 "2020-05-26T19:42:59Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Ali\_TeamRevived](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/ali_teamrevived/32/623450_2.png) [@Ali\_TeamRevived](https://forums.unrealengine.com/u/Ali_TeamRevived)\
**Post date:** [May 26, 2020, 7:48pm UTC](https://forums.unrealengine.com/t/why-i-cannot-call-this-physx-function/465842/7 "2020-05-26T19:48:11Z")

</div>

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.
