Problems when building PhysX 3.3 in Visual Studio 2015

Hey folks

I have been wanting to try out PhysX for some projects but I’m having some issues when trying to build the source of Physx SDK.

When trying to build i get the error:

Severity Code Description Project File Line Suppression State
Error C2373 ‘__pfnDliNotifyHook2’: redefinition; different type modifiers PhysXCooking C:\Users\Red\Documents\PhysX-3.3-master\PhysXSDK\Source\PhysXCooking\src\windows\WindowsCookingDelayLoadHook.cpp 64

which links too:
PfnDliHook __pfnDliNotifyHook2 = delayHook;

When searching around the internets for an answer I have been unable to figure out what to do. Am I missing some software packages? This is the information about my Visual Studio installation:

Microsoft Visual Studio Community 2015
Version 14.0.25424.00 Update 3
Microsoft .NET Framework
Version 4.6.0158

Figured out a fix

PfnDliHook __pfnDliNotifyHook2 = delayHook;

needs to be made const

const PfnDliHook __pfnDliNotifyHook2 = delayHook;

this made it work.

Probably a very newbi mistake but hey, im a nub.

Hey, thank you! I ran into the same thing. I’m a newb at building PhysX as well, but I don’t think this one was our fault.

Hi, I think this has something to do with backwards compatibility. I used this define “DELAYIMP_INSECURE_WRITABLE_HOOKS” . check file delayimp.h