gpt4 book ai didi

c++ - SDL中没有可用的视频设备

转载 作者:行者123 更新时间:2023-12-02 10:03:27 27 4
gpt4 key购买 nike

我正在使用的SDL-2库是从源代码编译的。

每当我尝试在X11上运行任何使用SDL-2的程序时,都会出现此错误:

SDL_Init Error: No available video device

我正在Linux Mint 19.3 Tricia上的命令行中运行这些程序。

以下是 ./configure摘要:
SDL2 Configure Summary:
Building Shared Libraries
Building Static Libraries
Enabled modules : atomic audio video render events joystick haptic sensor power filesystem threads timers file loadso cpuinfo assembly
Assembly Math : mmx 3dnow sse sse2 sse3
Audio drivers : disk dummy oss
Video drivers : dummy opengl_es2 vulkan
Input drivers : linuxev linuxkd
Using libsamplerate : NO
Using libudev : NO
Using dbus : NO
Using ime : YES
Using ibus : NO
Using fcitx : NO

最佳答案

看起来您的SDL构建缺少X11后端。

Mint看起来足够Debian-y,因此sudo apt build-dep libsdl2应该引入所需的-dev软件包。然后,您可以重新运行./configure并重新构建/重新安装SDL。

确保仔细检查Video drivers摘要中的configure行是否包含您要使用的后端。

如果build-dep方法过于手工编写,则 docs/README-linux.md 具有(有点旧)逐项列出的-dev软件包列表:

================================================================================
Build Dependencies
================================================================================

Ubuntu 13.04, all available features enabled:

sudo apt-get install build-essential mercurial make cmake autoconf automake \
libtool libasound2-dev libpulse-dev libaudio-dev libx11-dev libxext-dev \
libxrandr-dev libxcursor-dev libxi-dev libxinerama-dev libxxf86vm-dev \
libxss-dev libgl1-mesa-dev libesd0-dev libdbus-1-dev libudev-dev \
libgles1-mesa-dev libgles2-mesa-dev libegl1-mesa-dev libibus-1.0-dev \
fcitx-libs-dev libsamplerate0-dev libsndio-dev

Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
to that command line for Wayland support.

NOTES:
- This includes all the audio targets except arts, because Ubuntu pulled the
artsc0-dev package, but in theory SDL still supports it.
- libsamplerate0-dev lets SDL optionally link to libresamplerate at runtime
for higher-quality audio resampling. SDL will work without it if the library
is missing, so it's safe to build in support even if the end user doesn't
have this library installed.
- DirectFB isn't included because the configure script (currently) fails to find
it at all. You can do "sudo apt-get install libdirectfb-dev" and fix the
configure script to include DirectFB support. Send patches. :)

关于c++ - SDL中没有可用的视频设备,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61398955/

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