未找到本地安装的 Lib

未找到本地安装的 Lib

我想在不使用 sudo 的情况下安装 dungeon crawl。没有安装 SDL,所以我在本地安装了它,但在编译 crawl 时找不到它。

以下是我的做法:我下载了库“SDL2-2.0.5.tar.gz”并将其解压到某个位置。从新的“SDL2-2.0.5”文件夹中,我安装了该库:

./configure --prefix=/home/vulpo/local
make
make install

例如,我可以看到该文件位于预期位置:

/home/vulpo/local/include/SDL2/SDL.h

我是这样设置环境变量的:

$ export PATH=$PATH:/home/vulpo/local
$ export LD_LIBRARY_PATH=/home/vulpo/local/lib

LD_LIBRARY_PATH 以前是空的

我认为这足以考虑我的本地 SDL,但是在安装程序时出现错误:

vulpo@FOXBOX:~/.dungeoncrawl/crawl/crawl-ref/source$ make TILES=y
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package freetype2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `freetype2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'freetype2' found
Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found
Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found
Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found
Package sdl2 was not found in the pkg-config search path.
Perhaps you should add the directory containing `sdl2.pc'
to the PKG_CONFIG_PATH environment variable
No package 'sdl2' found
make -C rltiles all ARCH=x86_64-linux-gnu TILES=y
make[1]: Entering directory '/home/vulpo/.dungeoncrawl/crawl/crawl-ref/source/rltiles'
make[1]: Leaving directory '/home/vulpo/.dungeoncrawl/crawl/crawl-ref/source/rltiles'
    CXX windowmanager-sdl.o
windowmanager-sdl.cc:21:24: fatal error: SDL2/SDL.h: No such file or directory
 #  include <SDL2/SDL.h>
                        ^
compilation terminated.
Makefile:1550: recipe for target 'windowmanager-sdl.o' failed
make: *** [windowmanager-sdl.o] Error 1
vulpo@FOXBOX:~/.dungeoncrawl/crawl/crawl-ref/source$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/vulpo/local
vulpo@FOXBOX:~/.dungeoncrawl/crawl/crawl-ref/source$ echo $LD_LIBRARY_PATH 
/home/vulpo/local/lib

/home/vulpo/local/*将所有目录都包含在我的路径中也不起作用。

export PATH=$PATH:/home/vulpo/local/bin:/home/vulpo/local/include:/home/vulpo/local/lib:/home/vulpo/local/share

那么在程序编译中使用本地 SDL 的正确方法是什么?

答案1

由于您想以用户身份而不是 root 身份进行此操作,因此您还需要会话可用的依赖项。

Package freetype2 was not found in the pkg-config search path.

尝试下载并将 freetype2 包添加到您的项目目录。

相关内容