linux - 未定义对 `XF86VidModeSwitchToMode' 的引用

标签 linux physx

当我在ubuntu 12.04中编译physx的demo时,总是出现一些错误,就像

./../../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'

我添加了 header 包含编译器提到的函数,但错误仍然出现。 我已经筋疲力尽了有人可以帮助我吗?

最佳答案

只需将 -lXxf86vm -lXext -lX11 标志添加到链接器设置中即可。并且不要忘记在 aptitude 中安装 libxxf86vm-dev 包。

关于linux - 未定义对 `XF86VidModeSwitchToMode' 的引用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10811037/

相关文章:

regex - 使用sed删除不匹配的部分

game-engine - NVidia PhysX 3.4 的原生 C API

linux - 将 hash-sign-starting-string 参数传递给 shell 脚本

c++ - Eclipse C.D.T.无法识别标准功能或 "NULL"

unity3d - 在 Unity3d 中更改 Spring 接头的静止长度

c++ - Physx-使用Come函数链接问题(函数中引用的__imp_PxCreateBasePhysics…)

c++ - 如何在 PhysX 中创建非碰撞刚体

c++ - PhysX.sln 无法编译(PhysX 3.4)

linux - 如何在没有中间文件夹的情况下将文件添加到 zip 存档

linux - 如何让 Bash 循环休眠几秒钟?