PROBLEM WITH NxCreateApexSDK

Started by
1 comment, last by cgrant 9 years, 6 months ago
Hi There! I'm just starting to develop with APEX and I'm getting an access violation error with NxCreateApexSDK! Any help or example is appreciated. Here is my initialization code:

//Creating foundation for PhysX
PxFoundation* foundation = PxCreateFoundation(PX_PHYSICS_VERSION, gDefaultAllocatorCallback, gDefaultErrorCallback);
if (foundation == nullptr)return false;
 
//Creating instance of PhysX SDK
gPhysicsSDK = PxCreatePhysics(PX_PHYSICS_VERSION, *foundation, PxTolerancesScale());
if (gPhysicsSDK == nullptr)return false;
 
//Creating cooking interface
mPhysxCooking = PxCreateCooking(PX_PHYSICS_VERSION,*foundation, PxCookingParams(gPhysicsSDK->getTolerancesScale()));
if (mPhysxCooking == nullptr)return false;
 
// Init Physx extensions
if (!PxInitExtensions(*gPhysicsSDK))return false;
 
//Creating instance of Apex SDK
ZeusResourceCallback* rcallback = new ZeusResourceCallback(); // https://github.com/clucasa/Olympus/blob/master/Olympus/ZeusResourceCallback.h
physx::apex::NxUserRenderResourceManager* mRenderResourceManager;
mRenderResourceManager = new NullRenderResourceManager(); // From shared/external/NullRenderer.h (Included with apex)
NxApexSDKDesc       apexDesc;
apexDesc.physXSDK = gPhysicsSDK;
apexDesc.cooking = mPhysxCooking;
apexDesc.renderResourceManager = mRenderResourceManager;
apexDesc.resourceCallback = rcallback;
 
if (apexDesc.isValid())
{
NxApexCreateError   errorCode;
gApexSDK = NxCreateApexSDK(apexDesc, &errorCode); // <- Here is where I get the access violation
if (gApexSDK == nullptr)return false;
}
else
return false;
Advertisement

Odd, I swaped the ApexFrameWorkCHECKED.lib for ApexFrameWork.lib and now it works. Any idea why?

The libraries were most likely created with different version of the C-runtime..its never a good idea to mix and match the 2..

This topic is closed to new replies.

Advertisement