Hello,
I am getting the linker error
Error 3 error LNK2019: unresolved external symbol “public: virtual __thiscall physx::PxDefaultErrorCallback::~PxDefaultErrorCallback(void)” (??1PxDefaultErrorCallback@physx@@UAE@XZ) referenced in function “void __cdecl `dynamic atexit destructor for ‘gDefaultErrorCallback’'(void)” (??__FgDefaultErrorCallback@@YAXXZ) C:\karemus2\physx2\physx2\Source1.obj
I do not why, because I have linked every available library:
Source code:
#include <iostream>
#include <pxphysicsapi.h>
#include <pxdefaulterrorcallback.h>
#include <pxdefaultallocator.h>
#include <Windows.h>
#pragma comment(lib, "PhysX3_x86.lib")
#pragma comment(lib,"PhysX3Common_x86.lib")
#pragma comment(lib, "PhysX3CharacterKinematic_x86.lib")
#pragma comment(lib, "PhysX3CharacterKinematicCHECKED_x86.lib")
#pragma comment(lib, "PhysX3CharacterKinematicPROFILE_x86.lib")
#pragma comment(lib, "PhysX3PROFILE_x86.lib")
//#pragma comment(lib, "PhysX3ExtensionsPROFILE.lib")
#pragma comment(lib, "PhysX3CHECKED_x86.lib")
//#pragma comment(lib, "PhysX3Extensions.lib")
//#pragma comment(lib, "PhysX3ExtensionsCHECKED.lib")
#pragma comment(lib, "PhysX3CookingPROFILE_x86.lib")
#pragma comment(lib, "PhysX3CookingCHECKED_x86.lib")
#pragma comment(lib, "physx3common_x86.lib")
#pragma comment(lib, "physx3cooking_x86.lib")
#pragma comment(lib, "physx3commonprofile_x86.lib")
#pragma comment(lib, "physx3commonchecked_x86.lib")
#pragma comment(lib, "physx3vehicle.lib")
#pragma comment(lib, "pxtask.lib")
#pragma comment(lib, "physx3vehiclechecked.lib")
#pragma comment(lib, "pxtaskchecked.lib")
#pragma comment(lib, "physx3vehicleprofile.lib")
#pragma comment(lib, "physxvisualdebuggersdkprofile.lib")
//#pragma comment(lib, "physxprofilesdk.lib")
//#pragma comment(lib, "physxprofilesdkchecked.lib")
#pragma comment(lib, "physxvisualdebuggersdkchecked.lib")
#pragma comment(lib, "physxvisualdebuggersdk.lib")
#pragma comment(lib, "pxtaskprofile.lib")
//#pragma comment(lib, "physxprofilesdkprofile.lib")
#pragma comment(lib, "pxtoolkitdebug.lib")
#pragma comment(lib, "repx3.lib")
#pragma comment(lib, "repx3checked.lib")
#pragma comment(lib, "repx3profile.lib")
#pragma comment(lib, "repxupgrader3.lib")
#pragma comment(lib, "repxupgrader3checked.lib")
#pragma comment(lib, "samplesdebug.lib")
#pragma comment(lib, "sampleplatform-mtdebug.lib")
#pragma comment(lib, "samplerenderer-mtdebug.lib")
#pragma comment(lib, "repxupgrader3profile.lib")
#pragma comment(lib, "samplebasedebug.lib")
#pragma comment(lib, "sampleframework-mtdebug.lib")
using namespace std;
using namespace physx;
//#pragma comment(lib, "Foundation")
//#pragma comment(lib, "PhysX3Extensions.lib")
const int WINDOW_WIDTH=1024,
WINDOW_HEIGHT=768;
void InitializePhysX();
void ShutdownPhysX();
static PxPhysics* gPhysicsSDK = NULL;
static PxDefaultErrorCallback gDefaultErrorCallback;
static PxDefaultAllocator gDefaultAllocatorCallback;
bool recordMemoryAllocations = true;
physx::PxFoundation* mFoundation = PxCreateFoundation(PX_PHYSICS_VERSION, gDefaultAllocatorCallback, gDefaultErrorCallback);
physx::PxProfileZoneManager *mProfileZoneManager = &physx::PxProfileZoneManager::createProfileZoneManager(mFoundation);
int WINAPI WinMain(HINSTANCE hinstance,HINSTANCE hprevinstance,PSTR pstrcmdline,int cmdshow)
{
InitializePhysX();
ShutdownPhysX();
return 0;
}
void InitializePhysX() {
gPhysicsSDK = PxCreatePhysics(PX_PHYSICS_VERSION, *mFoundation,physx::PxTolerancesScale(), recordMemoryAllocations, mProfileZoneManager );
if(gPhysicsSDK == NULL) {
cerr<<"Error creating PhysX device."<<endl;
cerr<<"Exiting..."<<endl;
exit(1);
}
}
void ShutdownPhysX() {
gPhysicsSDK->release();
}