当我在ubuntu 12.04中编译physx的演示时,总是会出现一些错误,就像
./../../SampleFramework/platform/lib/linux64/libSamplePlatform-MTCHECKED.a(LinuxSamplePlatform.cpp.o): In function `SampleFramework::LinuxPlatform::closeWindow()':
/home/squall/physx/Samples/compiler/linux64public/./../../SampleFramework/platform/src/linux/LinuxSamplePlatform.cpp:369: undefined reference to `XF86VidModeSwitchToMode'
/home/squall/physx/Samples/compiler/linux64public/./../../SampleFramework/platform/src/linux/LinuxSamplePlatform.cpp:370: undefined reference to `XF86VidModeSetViewPort'
./../../SampleFramework/platform/lib/linux64/libSamplePlatform-MTCHECKED.a(LinuxSamplePlatform.cpp.o): In function `SampleFramework::LinuxPlatform::openWindow(unsigned int&, unsigned int&, char const*, bool)':
/home/squall/physx/Samples/compiler/linux64public/./../../SampleFramework/platform/src/linux/LinuxSamplePlatform.cpp:271: undefined reference to `XF86VidModeQueryVersion'
/home/squall/physx/Samples/compiler/linux64public/./../../SampleFramework/platform/src/linux/LinuxSamplePlatform.cpp:299: undefined reference to `XF86VidModeGetAllModeLines'
/home/squall/physx/Samples/compiler/linux64public/./../../SampleFramework/platform/src/linux/LinuxSamplePlatform.cpp:310: undefined reference to `XF86VidModeSwitchToMode'
/home/squall/physx/Samples/compiler/linux64public/./../../SampleFramework/platform/src/linux/LinuxSamplePlatform.cpp:311: undefined reference to `XF86VidModeSetViewPort'
我添加了头文件,其中包含编译器已提及的功能,但错误仍然出现。
我好累有谁能够帮助我?
最佳答案
只需将-lXxf86vm -lXext -lX11标志添加到链接器设置。并且不要忘了在aptitude中安装libxxf86vm-dev软件包。
关于linux - 未定义对 `XF86VidModeSwitchToMode'的引用,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/10811037/