• Advertisement
Sign in to follow this  

PROBLEM WITH NxCreateApexSDK

This topic is 1238 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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;

Share this post


Link to post
Share on other sites
Advertisement

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

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement