编译时无法链接到SDL2库

问题描述 投票:0回答:1

我正在尝试编译需要SDL2的应用程序。我的系统上已经安装了所有依赖项(基于Arch的Linux发行版)。但是由于某些原因,链接器无法找到所需的SDL2库。

我尝试:

制作参数

成功构建了几件东西,然后:

Linking...
/usr/bin/ld: cannot find -lSDL2
/usr/bin/ld: cannot find -lunwind-generic
/usr/bin/ld: cannot find -lunwind
/usr/bin/ld: cannot find -lglib-2.0
/usr/bin/ld: cannot find -lgobject-2.0
/usr/bin/ld: cannot find -lgio-2.0
/usr/bin/ld: cannot find -libus-1.0
/usr/bin/ld: cannot find -ldbus-1
/usr/bin/ld: cannot find -lSDL2
collect2: error: ld returned 1 exit status
make: *** [Makefile:169: build/release] Error 1

相应于

ldconfig -p | grep SDL

我的系统具有:

    libSDL2pp.so.8 (libc6,x86-64) => /usr/lib/libSDL2pp.so.8
    libSDL2pp.so (libc6,x86-64) => /usr/lib/libSDL2pp.so
    libSDL2_ttf-2.0.so.0 (libc6,x86-64) => /usr/lib/libSDL2_ttf-2.0.so.0
    libSDL2_ttf-2.0.so.0 (libc6) => /usr/lib32/libSDL2_ttf-2.0.so.0
    libSDL2_mixer-2.0.so.0 (libc6,x86-64) => /usr/lib/libSDL2_mixer-2.0.so.0
    libSDL2_mixer-2.0.so.0 (libc6) => /usr/lib32/libSDL2_mixer-2.0.so.0
    libSDL2_image-2.0.so.0 (libc6,x86-64) => /usr/lib/libSDL2_image-2.0.so.0
    libSDL2_image-2.0.so.0 (libc6) => /usr/lib32/libSDL2_image-2.0.so.0
    libSDL2-2.0.so.0 (libc6,x86-64) => /usr/lib/libSDL2-2.0.so.0
    libSDL2-2.0.so.0 (libc6) => /usr/lib32/libSDL2-2.0.so.0
    libSDL2-2.0.so (libc6,x86-64) => /usr/lib/libSDL2-2.0.so
    libSDL2-2.0.so (libc6) => /usr/lib32/libSDL2-2.0.so
    libSDL_ttf-2.0.so.0 (libc6,x86-64) => /usr/lib/libSDL_ttf-2.0.so.0
    libSDL_ttf-2.0.so.0 (libc6) => /usr/lib32/libSDL_ttf-2.0.so.0
    libSDL_sound-1.0.so.1 (libc6,x86-64) => /usr/lib/libSDL_sound-1.0.so.1
    libSDL_net-1.2.so.0 (libc6,x86-64) => /usr/lib/libSDL_net-1.2.so.0
    libSDL_mixer-1.2.so.0 (libc6,x86-64) => /usr/lib/libSDL_mixer-1.2.so.0
    libSDL_mixer-1.2.so.0 (libc6) => /usr/lib32/libSDL_mixer-1.2.so.0
    libSDL_image-1.2.so.0 (libc6,x86-64) => /usr/lib/libSDL_image-1.2.so.0
    libSDL_image-1.2.so.0 (libc6) => /usr/lib32/libSDL_image-1.2.so.0
    libSDL-1.2.so.0 (libc6,x86-64) => /usr/lib/libSDL-1.2.so.0
    libSDL-1.2.so.0 (libc6) => /usr/lib32/libSDL-1.2.so.0

可能是什么问题?

linux build compilation sdl lib
1个回答
0
投票

您似乎在arch linux软件包的列表中缺少一些files。最重要的是,libSDL2.so。可能想重试安装,并在可能的情况下使用程序包管理器。

© www.soinside.com 2019 - 2024. All rights reserved.