无法在 Linux 上找到SDL2_gfx库
Unable to find SDL2_gfx library on linux
我正在尝试安装 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 的结果与之前完全相同。
- 如何创建事件驱动的 SDL2 应用程序
- 使用 SDL2 和SDL_image C++加载图像
- 将 SDL2 与 CMake 链接起来
- SDL2 透明背景
- 如何在使用 SDL2 的 Eclipse 中构建 c++ 程序
- 不带轮询的 SDL2 事件回调
- C++ SDL2:如何将矩形渲染到多个视口中
- SDL2 调整窗口大小后如何缩放鼠标坐标?
- SDL2 二维纹理分配/池化
- 如何使用 sdl2 快速绘制像素网格?
- 看不到文件'SDL2.lib'
- 我的 SDL2 程序需要哪些二进制文件,以便它在另一台未安装 SDL2 的计算机中工作
- SDL2 无法正确绘制矩形
- 实施英特尔实感和 SDL2 时出现问题
- 找不到 sdl2.dll
- SDL2 程序只写入部分字符串
- 为什么在使用 SDL2 时仍然收到'undefined reference'链接器错误?
- 在另一台 PC 上执行程序时加载 SDL2 共享库时出错
- SDL2 (C++) 如何使图像变小
- 无法用SDL2 GFX绘制一个填充的圆圈