Добрый день уважаемые форумчане. Такая проблема у меня. Хочу с помощью движка PhysX запустить физику танка. Почитал доки PhysX в разделе Vehicle и нашел как раз то что мне нужно - SnippetVehicleTank. Нашел этот код, там несколько файлов, а именно:
SnippetVehicleConcurrency.h
SnippetVehicleCreate.h
SnippetVehicleFilterShader.h
SnippetVehicleProfiler.h
SnippetVehicleRaycast.h
SnippetVehicleTireFriction.h
SnippetVehicleWheelQueryResult.h
SnippetVehicle4WCreate.cpp
SnippetVehicleCreate.cpp
SnippetVehicleFilterShader.cpp
SnippetVehicleNoDriveCreate.cpp
SnippetVehicleRaycast.cpp
SnippetVehicleTankCreate.cpp
SnippetVehicleTireFriction.cpp
Ну и естественно самые главные файлы:
SnippetVehicleTank.cpp
SnippetVehicleTankRender.cpp
У PhysX все работает как надо. А у меня как всегда. Я как только добавляю все эти файлы в свой проект, то мне компилятор выдает вот такие ошибки:
1>------ Build started: Project: Tanks, Configuration: Debug Win32 ------
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: static class physx::PxVehicleWheelsSimData * __cdecl physx::PxVehicleWheelsSimData::allocate(unsigned int)" (?allocate@PxVehicleWheelsSimData@physx@@SAPAV12@I@Z) referenced in function "class physx::PxVehicleDrive4W * __cdecl createVehicle4W(struct VehicleDesc const &,class physx::PxPhysics *,class physx::PxCooking *)" (?createVehicle4W@@YAPAVPxVehicleDrive4W@physx@@ABUVehicleDesc@@PAVPxPhysics@2@PAVPxCooking@2@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::free(void)" (?free@PxVehicleWheelsSimData@physx@@QAEXXZ) referenced in function "class physx::PxVehicleDrive4W * __cdecl createVehicle4W(struct VehicleDesc const &,class physx::PxPhysics *,class physx::PxCooking *)" (?createVehicle4W@@YAPAVPxVehicleDrive4W@physx@@ABUVehicleDesc@@PAVPxPhysics@2@PAVPxCooking@2@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: class physx::PxVec3 const & __thiscall physx::PxVehicleWheelsSimData::getWheelCentreOffset(unsigned int)const " (?getWheelCentreOffset@PxVehicleWheelsSimData@physx@@QBEABVPxVec3@2@I@Z) referenced in function "class physx::PxVehicleDrive4W * __cdecl createVehicle4W(struct VehicleDesc const &,class physx::PxPhysics *,class physx::PxCooking *)" (?createVehicle4W@@YAPAVPxVehicleDrive4W@physx@@ABUVehicleDesc@@PAVPxPhysics@2@PAVPxCooking@2@@Z)
1>SnippetVehicleCreate.obj : error LNK2001: unresolved external symbol "public: class physx::PxVec3 const & __thiscall physx::PxVehicleWheelsSimData::getWheelCentreOffset(unsigned int)const " (?getWheelCentreOffset@PxVehicleWheelsSimData@physx@@QBEABVPxVec3@2@I@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setSuspensionData(unsigned int,class physx::PxVehicleSuspensionData const &)" (?setSuspensionData@PxVehicleWheelsSimData@physx@@QAEXIABVPxVehicleSuspensionData@2@@Z) referenced in function "void __cdecl FourWheel::setupWheelsSimulationData(float,float,float,float,unsigned int,class physx::PxVec3 const *,class physx::PxVec3 const &,float,class physx::PxVehicleWheelsSimData *)" (?setupWheelsSimulationData@FourWheel@@YAXMMMMIPBVPxVec3@physx@@ABV23@MPAVPxVehicleWheelsSimData@3@@Z)
1>SnippetVehicleCreate.obj : error LNK2001: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setSuspensionData(unsigned int,class physx::PxVehicleSuspensionData const &)" (?setSuspensionData@PxVehicleWheelsSimData@physx@@QAEXIABVPxVehicleSuspensionData@2@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setWheelData(unsigned int,class physx::PxVehicleWheelData const &)" (?setWheelData@PxVehicleWheelsSimData@physx@@QAEXIABVPxVehicleWheelData@2@@Z) referenced in function "void __cdecl FourWheel::setupWheelsSimulationData(float,float,float,float,unsigned int,class physx::PxVec3 const *,class physx::PxVec3 const &,float,class physx::PxVehicleWheelsSimData *)" (?setupWheelsSimulationData@FourWheel@@YAXMMMMIPBVPxVec3@physx@@ABV23@MPAVPxVehicleWheelsSimData@3@@Z)
1>SnippetVehicleCreate.obj : error LNK2001: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setWheelData(unsigned int,class physx::PxVehicleWheelData const &)" (?setWheelData@PxVehicleWheelsSimData@physx@@QAEXIABVPxVehicleWheelData@2@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setTireData(unsigned int,class physx::PxVehicleTireData const &)" (?setTireData@PxVehicleWheelsSimData@physx@@QAEXIABVPxVehicleTireData@2@@Z) referenced in function "void __cdecl FourWheel::setupWheelsSimulationData(float,float,float,float,unsigned int,class physx::PxVec3 const *,class physx::PxVec3 const &,float,class physx::PxVehicleWheelsSimData *)" (?setupWheelsSimulationData@FourWheel@@YAXMMMMIPBVPxVec3@physx@@ABV23@MPAVPxVehicleWheelsSimData@3@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setSuspTravelDirection(unsigned int,class physx::PxVec3 const &)" (?setSuspTravelDirection@PxVehicleWheelsSimData@physx@@QAEXIABVPxVec3@2@@Z) referenced in function "void __cdecl FourWheel::setupWheelsSimulationData(float,float,float,float,unsigned int,class physx::PxVec3 const *,class physx::PxVec3 const &,float,class physx::PxVehicleWheelsSimData *)" (?setupWheelsSimulationData@FourWheel@@YAXMMMMIPBVPxVec3@physx@@ABV23@MPAVPxVehicleWheelsSimData@3@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setSuspForceAppPointOffset(unsigned int,class physx::PxVec3 const &)" (?setSuspForceAppPointOffset@PxVehicleWheelsSimData@physx@@QAEXIABVPxVec3@2@@Z) referenced in function "void __cdecl FourWheel::setupWheelsSimulationData(float,float,float,float,unsigned int,class physx::PxVec3 const *,class physx::PxVec3 const &,float,class physx::PxVehicleWheelsSimData *)" (?setupWheelsSimulationData@FourWheel@@YAXMMMMIPBVPxVec3@physx@@ABV23@MPAVPxVehicleWheelsSimData@3@@Z)
1>SnippetVehicleCreate.obj : error LNK2001: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setSuspForceAppPointOffset(unsigned int,class physx::PxVec3 const &)" (?setSuspForceAppPointOffset@PxVehicleWheelsSimData@physx@@QAEXIABVPxVec3@2@@Z)
1>SnippetVehicle4WCreate.obj : error LNK2019: unresolved external symbol "public: void __thiscall physx::PxVehicleWheelsSimData::setTireForceAppPointOffset(unsigned int,class physx::PxVec3 const &)" (?setTireForceAppPointOffset@PxVehicleWheelsSimData@physx@@QAEXIABVPxVec3@2@@Z) referenced in function "void __cdecl FourWheel::setupWheelsSimulationData(float,float,float,float,unsigned int,class physx::PxVec3 const *,class physx::PxVec3 const &,float,class physx::PxVehicleWheelsSimData *)" (?setupWheelsSimulationData@FourWheel@@YAXMMMMIPBVPxVec3@physx@@ABV23@MPAVPxVehicleWheelsSimData@3@@Z)
...
...
и тд
В чем может быть трабл? Помогите пожалуйста
У меня физикс тоже не запустился, из-за отсутсвия поодержи моей версии студии.
Либы все подключил? Их там много разных одинаковых под конкретные проекты.
Да я использую PhysX в других своих проектах. Первый раз захотел попробовать поработать с Vehicle, и вот что получил в итоге:(
bretbas
> SnippetVehicleConcurrency.h
А ты точно уверен, что оно тебе нужно?
> unresolved external symbol
Чего-то не передал линкеру. Может, саму библиотеку, может, скомпилированные объектные файлы.
Delfigamer, на счет SnippetVehicleConcurrency.h не знаю, может и не нужно) делаю пока что интуитивно все, прочитал доки, открыл сниппет, убрал все не нужные файлы. Оставил все файлы, без которых PhysX-проект не хочет компилиться. Файл SnippetVehicleConcurrency.h один из них, а остальные - это те, которые я написал выше
явно какие-то библиотеки не доложил.. когда-то тоже пробывал танк делать, даже что-то завелось
может кому-то пригодиться для запуска под VS2015
У меня заработало 3.3.3
да все библиотеки подключены. Самое главное что в проекте physX все работает, а как только я перекидываю эти же файлы в свой проект, подключаю те же файлы, то сразу выдаёт ошибки, которые я написал выше
методом научного тыка, понял что вот эти библиотеки нужно было подключить в Linker'ре:
PhysX3CharacterKinematicDEBUG_x86.lib
PhysX3VehicleDEBUG.lib
PhysXProfileSDKDEBUG.lib
PhysXVisualDebuggerSDKDEBUG.lib
PxTaskDEBUG.lib
хотя в проекте PhysX'а и без них все работает...как то странно.
Тема исчерпана, спасибо всем)
Тема в архиве.