无法在 Linux 上找到SDL2_gfx库

Unable to find SDL2_gfx library on linux

本文关键字:SDL2 gfx Linux      更新时间:2023-10-16

我正在尝试安装 gfx2 以将其与 SDL2 一起使用 C++。

我按照官方文档中描述的安装过程进行操作。

一切都很顺利,除了当我开始测试安装成功时,在测试程序部分,在步骤./configure中,我得到以下结果:

checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for an ANSI C-conforming const... yes checking for pkg-config... /usr/bin/pkg-config checking pkg-config is at least version 0.9.0... yes checking for SDL... yes checking how to run the C preprocessor... gcc -E checking for X... libraries , headers checking for OpenGL support... yes checking for OpenGL ES support... no checking for OpenGL ES2 support... no checking for pixelColor in -lSDL2_gfx... no configure: error: *** Unable to find SDL2_gfx library

我在研究中没有发现任何类似的问题。

显然该库没有安装在它应该在的地方(如果有的话),但我不知道脚本在哪里看。

有什么想法吗?

谢谢你的帮助。

确保您以 root 权限运行make install,例如 sudo make install如果以非 root 用户身份登录。或者,您可以在LIBRARY_PATH环境变量中指定库二进制文件的位置,例如 如果需要,export LIBRARY_PATH=$LIBRARY_PATH:~/sdl2和标头位于变量C_INCLUDE_PATH

谢谢你的回答,

当我输入 make install 命令时,我确实具有 root 权限(如果没有,它会给出错误)。

我尝试了export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib(安装库的目标)和export C_INCLUDE_PATH=$INCLUDE_PATH:/usr/local/include/SDL2/(但这里只有 SDL2 标头,没有 gfx 的痕迹)。

./configure 的结果与之前完全相同。