gpt4 book ai didi

linux - 对 `XF86VidModeSwitchToMode' 的 undefined reference

转载 作者:太空狗 更新时间:2023-10-29 12:06:16 24 4
gpt4 key购买 nike

当我在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'

我在头文件中添加了编译器提到的函数,但仍然出现错误。我精疲力竭。谁能帮帮我?

最佳答案

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

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

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com