Makefile 制造can';找不到SDL_mixer.h,但我包含了SDL dir
我正试图从源代码构建eduke32 除其他外,它需要SDL_mixer.h 我有:Makefile 制造can';找不到SDL_mixer.h,但我包含了SDL dir,makefile,sdl,sdl-mixer,Makefile,Sdl,Sdl Mixer,我正试图从源代码构建eduke32 除其他外,它需要SDL_mixer.h 我有: $ locate SDL_mixer.h /usr/include/SDL/SDL_mixer.h (我已经安装了develtools组,以及许多其他开发包) 但当我开始构建时,我得到了SDL_mixer file not found错误 $ make Build started using: compiler: "gcc -Wimplicit -Wdeclaration-after-statement -O
$ locate SDL_mixer.h
/usr/include/SDL/SDL_mixer.h
(我已经安装了develtools组,以及许多其他开发包)
但当我开始构建时,我得到了SDL_mixer file not found错误
$ 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/
这里发生了什么事?有人有线索吗?我检查了Makefile,发现程序正在寻找SDL**2**/SDL\u mixer.h 我安装了SDL2_mixer-devel软件包,一切正常
我在make中使用--include dir选项似乎与我试图做的事情无关。(请参阅etan注释)make的
--include dir
参数用于make自身查找包含的makefile,而不是make运行的源代码编译。您需要编辑相应的/configure
参数或CFLAGS
或类似变量,才能将该路径传递到实际编译。感谢您对--include dir的解释。我不习惯使用make,正如您所看到的^^,我找到了问题的原因,请参见答案。