I am bridging Nvidia Blast to Unity, and I am running into the following error when PhysX is trying to delay load PhysX3CommonDEBUG_x64.dll
:
Unhandled exception at 0x00007FFDD7743FB8 (KernelBase.dll) in Unity.exe:
0xC06D007E: Module not found (parameters: 0x00000000005FC5B0).`
I am able to run this bridging program fine as a standalone console application (after changing the project type), but running the PhysX initialization inside of Unity causes the crash (here's Unity's stacktrace):
0x00007FFF4F543FB8 (KERNELBASE) RaiseException
0x00007FFEF0840835 (PhysX3DEBUG_x64) [f:\dd\vctools\delayimp\delayhlp.cpp:323] __delayLoadHelper2
0x00007FFEF0669011 (PhysX3DEBUG_x64) _tailMerge_physx3commondebug_x64_dll
0x00007FFEF051CDA4 (PhysX3DEBUG_x64) [c:\users\jesse\documents\github\physx-3.4\physx_3.4\source\physx\src\npfactory.cpp:67] physx::NpFactory::NpFactory
0x00007FFEF051D6ED (PhysX3DEBUG_x64) [c:\users\jesse\documents\github\physx-3.4\physx_3.4\source\physx\src\npfactory.cpp:122] physx::NpFactory::createInstance
0x00007FFEF0545721 (PhysX3DEBUG_x64) [c:\users\jesse\documents\github\physx-3.4\physx_3.4\source\physx\src\npphysics.cpp:269] physx::NpPhysics::createInstance
0x00007FFEF0544DAA (PhysX3DEBUG_x64) [c:\users\jesse\documents\github\physx-3.4\physx_3.4\source\physx\src\npphysics.cpp:831] PxCreateBasePhysics
0x00007FFF18D37FA3 (Fractre) [c:\users\jesse\documents\github\blast\compiler\fractre\fractre.cpp:60] Initialize
I can definetely confirm that PhysX3CommonDEBUG_x64.dll
and all other dlls are present in plugin directory (like Unity expects) and there were complaints when they were missing but now they've been addressed.
I have also ran Window's System File Checker and it found no integrity issues.
confirm that PhysX3CommonDEBUG_x64.dll and all other dlls are present in plugin directory (like Unity expects)
It doesn’t matter what Unity expects. When you use /DELAYLOAD
linker flag to link with a native DLL, it’s not Unity who’s loading that DLL — Windows does.
Here’s a documentation about DLL search order. There’s a special API you can call to specify custom DLL location but handle with care, could be security consequences if someone will trick your app to load a hacked version of that DLL instead of the correct one.
Couple other notes. Ensure you’re using correct architecture, i.e. both Unity project and PhysX are 64 bit. Also ensure any DLLs PhysX3CommonDEBUG depends on are also available for LoadLibrary.
Here's 3 solutions that will work (as of PhysX 4.1):
User contributions licensed under CC BY-SA 3.0