Hi
When I compile my project I’m getting this errors.
PhysX3CommonCHECKED_x86.lib(PhysX3CommonCHECKED_x86.dll) : error LNK2005: "public: class physx::PxFlags<enum physx::PxSerialFlag::Enum,unsigned short> __thiscall physx::PxFlags<enum physx::PxSerialFlag::Enum,unsigned short>::operator~(void)const " (??S?$PxFlags@W4Enum@PxSerialFlag@physx@@G@physx@@QBE?AV01@XZ) already defined in FreeCamera.obj
CPhysxPhysic::CPhysxPhysic(void)
{
m_Physics=NULL;
m_Foundation=NULL;
static PxDefaultErrorCallback gDefaultErrorCallback;
static PxDefaultAllocator gDefaultAllocatorCallback;
printf("initializing PhysX\n");
printf("creating Foundation\n");
// create foundation object with default error and allocator callbacks.
m_Foundation = PxCreateFoundation(PX_PHYSICS_VERSION,gDefaultAllocatorCallback,gDefaultErrorCallback);
printf("creating Physics\n");
// create Physics object with the created foundation and with a 'default' scale tolerance.
m_Physics = PxCreatePhysics(PX_PHYSICS_VERSION,*m_Foundation,PxTolerancesScale());
m_Cooking = PxCreateCooking(PX_PHYSICS_VERSION, *m_Foundation, PxCookingParams());
if (!m_Cooking)
printf("PxCreateCooking failed!\n");
if (!PxInitExtensions(*m_Physics))
printf("PxInitExtensions failed!\n");
m_ProfileZoneManager = &PxProfileZoneManager::createProfileZoneManager(m_Foundation);
if(!m_ProfileZoneManager)
printf("PxProfileZoneManager::createProfileZoneManager failed!\n");
#ifdef PX_WINDOWS
pxtask::CudaContextManagerDesc cudaContextManagerDesc;
m_CudaContextManager = pxtask::createCudaContextManager(*m_Foundation, cudaContextManagerDesc, m_ProfileZoneManager);
if( m_CudaContextManager )
{
if( !m_CudaContextManager->contextIsValid() )
{
m_CudaContextManager->release();
m_CudaContextManager = NULL;
}
}
#endif
PxInitVehicleSDK(*m_Physics);
PxVehicleSetBasisVectors(PxVec3(0,1,0),PxVec3(0,0,1));
// static PxDefaultSimulationFilterShader gDefaultFilterShader;
PxSceneDesc sceneDesc(m_Physics->getTolerancesScale());
sceneDesc.gravity = PxVec3(0.0f, -9.81f, 0.0f);
// customizeSceneDesc(sceneDesc);
if(!sceneDesc.cpuDispatcher)
{
m_CpuDispatcher = PxDefaultCpuDispatcherCreate(2);
if(!m_CpuDispatcher)
printf("PxDefaultCpuDispatcherCreate failed!\n");
sceneDesc.cpuDispatcher = m_CpuDispatcher;
}
if(!sceneDesc.filterShader)
sceneDesc.filterShader = PxDefaultSimulationFilterShader;
#ifdef PX_WINDOWS
if(!sceneDesc.gpuDispatcher && m_CudaContextManager)
{
sceneDesc.gpuDispatcher = m_CudaContextManager->getGpuDispatcher();
}
#endif
m_Scene = m_Physics->createScene(sceneDesc);
if (!m_Scene)
printf("createScene failed!\n");
printf("PhysX initialized\n");
}
when I remove this line its working.
if (!PxInitExtensions(*m_Physics))
printf(“PxInitExtensions failed!\n”);
what is the problem?