0

有什么方法可以集成 Qt 和 Physx,以便我可以在 Qt Creator 中使用 Physx?

4

1 回答 1

0

Unfortunately PhysX is compiled against the /MT (static run-time version), while Qt MSVC uses /MD. Meaning you will have to build a Qt MSVC static build with /MT. Even if you get it to run using Qt's shared version you will run into the following warning and possible problems:

defaultlib 'LIBCMT' conflicts with use of other libs...

This stackoverflow answer will help you get you started for a qt static build: How to build Qt 4.8/5.2 statically under VS2012, using the static MSVC runtime, with Windows XP support?

To use the PhysX library with Qt MSVC (MinGW is not compatible with PhysX), here's an example qmake configuration.

PHYSX = /path/to/physx/library

INCLUDEPATH += $${PHYSX}/Include
LIBS += -L$${PHYSX}/Lib/win64

LIBS += \
    -lPhysX3CharacterKinematic_x64 \
    -lPhysX3_x64 \
    -lPhysX3Common_x64 \
    -lPhysX3Cooking_x64 \
    -lPhysX3Extensions \
    -lPhysX3Vehicle \
    -lPhysXProfileSDK \
    -lPhysXVisualDebuggerSDK \
    -lPxTask
于 2014-04-19T05:05:36.500 回答