我试图从源代码构建eduke32。
除其他外,它需要SDL_mixer.h。
我确实拥有它:
$ locate SDL_mixer.h
/usr/include/SDL/SDL_mixer.h
(我安装了Devel Tools组,以及许多其他开发包)
但是当我开始构建时,我发现SDL_mixer文件找不到错误。
$ make
Build started using:
compiler: "gcc -Wimplicit -Wdeclaration-after-statement -O2 -funswitch-loops -fomit-frame-pointer -DNDEBUG -DUSING_LTO -flto -fno-stack-protector -W -Wall -Werror-implicit-function-declaration -Wpointer-arith -Wextra -funsigned-char -fno-strict-aliasing -DNO_GCC_BUILTINS -D_FORTIFY_SOURCE=2 -fjump-tables -Wno-unused-result -Wno-char-subscripts -DUSE_LIBPNG -DUSE_LIBVPX -Isource -Ibuild/include -Isource/jmact -Isource/jaudiolib/include -Isource/enet/include -fno-pic -DHAVE_GTK2 -pthread -I/usr/include/gtk-2.0 -I/usr/lib64/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng15 -I/usr/include/libdrm -I/usr/include/harfbuzz -DHAVE_INTTYPES -DSDL_TARGET=2 -I/usr/include/SDL2 -D_REENTRANT -DRENDERTYPESDL=1 -DMIXERTYPESDL=1 -Wno-strict-overflow -DUSE_OPENGL -DNOASM -DPOLYMER -Wno-attributes"
linker: " -flto -Wl,-Map=start.memmap -lrt -lFLAC -lvorbisfile -lvorbis -logg -lSDL2_mixer -lm -lvpx -lSDL2 -lpthread -ldl -pthread -lpng -lz "
Built object source/obj/game.o
Built object source/obj/global.o
In file included from build/include/mutex.h:11:0,
from build/include/cache1d.h:7,
from source/duke3d.h:43,
from source/sdlmusic.c:39:
build/include/sdl_inc.h:62:25: fatal error: SDL_mixer.h: No such file or directory
# include "SDL_mixer.h"
^
compilation terminated.
Failed building source/obj/sdlmusic.o from source/sdlmusic.c!
即使我添加了include-dir选项,也会发生这种情况:
$ make --include-dir=/usr/include/SDL/
这里发生了什么?有人有线索吗?
答案 0 :(得分:2)
我检查了Makefile,发现该程序正在寻找SDL ** 2 ** / SDL_mixer.h
我安装了SDL2_mixer-devel软件包,一切都很顺利。
我在make中使用--include-dir选项似乎与我试图做的事情无关。 (见etan评论)