unable to compile - #include <SDL.h>
Hello,
I have the following error when compiling defendguin: make make: sdl-config: Command not found make: sdl-config: Command not found cc -Wall -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES src/defendguin.c -c -o obj/defendguin.o src/defendguin.c:25:17: fatal error: SDL.h: No such file or directory #include <SDL.h> ^ compilation terminated. make: *** [obj/defendguin.o] Error 1 I have libSDL packages installed Opensuse 13.1 64bit os |
look (install) for your developer headers, libSDL-dev or libSDL-devel or how ever your distro names them.
|
On openSUSE, it's libSDL-devel.
|
yes, most distros make it whatever they want.
|
Thanks, I solved that problem, now the compiler complains about not finding SDL_mixer.h
make cc -Wall -I/usr/include/SDL -D_GNU_SOURCE=1 -D_REENTRANT -DDATA_PREFIX="/usr/local/share/defendguin/" -D__SOUND -DJOY_YES src/defendguin.c -c -o obj/defendguin.o src/defendguin.c:28:23: fatal error: SDL_mixer.h: No such file or directory #include <SDL_mixer.h> ^ compilation terminated. make: *** [obj/defendguin.o] Error 1 |
here is something on your distro and this issue?
https://forums.opensuse.org/showthre...to-on-openSUSE |
After searching my system, I have libsdl_mixer-1_2-0 installed, however, I can not find it. I have what appears to be all the sdl and sdl mixer files. The sdl folder I can find, but I can not find the mixer folder or the sdl mixer header file. If libsdl_mixer is listed, then it is installed. How do I include the mixer when doing the compile?
|
What application are you trying to compile?
That page I linked suggest using Code:
pkg-config --cflags SDL2 |
If I understand what the code in your post refers to, that I have to associate the compiler with the mixer? I am trying to compile Defendguin.
Listed below is the make file: # Makefile for defendguin # by Bill Kendrick # bill@newbreedsoftware.com # http://www.newbreedsoftware.com/defendguin/ # November 6, 1999 - January 29, 2006 # User-definable stuff: CFLAGS=-Wall -O2 #DATA_PREFIX=$(PWD)/data/ PREFIX=/usr/local MAN_PREFIX=$(PREFIX) BIN_PREFIX=$(PREFIX)/bin DATA_PREFIX=$(PREFIX)/share/defendguin/ JOY=YES # Other definitions: SDL_CFLAGS := $(shell sdl-config --cflags) SDL_LDFLAGS := $(shell sdl-config --libs) -L/usr/X11R6/lib MIXER=-lSDL_mixer NOSOUNDFLAG=__SOUND CFLAGS=-Wall $(SDL_CFLAGS) -DDATA_PREFIX="$(DATA_PREFIX)" -D$(NOSOUNDFLAG) \ -DJOY_$(JOY) SDL_LIB=$(SDL_LDFLAGS) $(MIXER) # Make commands: all: defendguin nosound: make defendguin MIXER= NOSOUNDFLAG=NOSOUND install: defendguin install -d $(DATA_PREFIX) cp -R data/* $(DATA_PREFIX) chmod -R a+rX,g-w,o-w $(DATA_PREFIX) cp defendguin $(BIN_PREFIX)/ chmod a+rx,g-w,o-w $(BIN_PREFIX)/defendguin -mkdir -p $(MAN_PREFIX)/man/man6/ cp src/defendguin.6 $(MAN_PREFIX)/man/man6/ chmod a+rx,g-w,o-w $(MAN_PREFIX)/man/man6/defendguin.6 uninstall: -rm -r $(DATA_PREFIX) -rm $(PREFIX)/bin/defendguin -rm $(PREFIX)/man/man6/defendguin.6 clean: -rm defendguin -rm obj/*.o # Main executable: defendguin: obj/defendguin.o $(CC) $(CFLAGS) obj/defendguin.o -o defendguin $(SDL_LIB) -lm # Main object: obj/defendguin.o: src/defendguin.c $(CC) $(CFLAGS) src/defendguin.c -c -o obj/defendguin.o |
let me run that on my system as see if I can figire it out for you.
I just issued 'make' bamn done. you installed you SDL devel here https://software.opensuse.org/package/libSDL-1_2-0 do a find for the files it says it cannot find, Code:
find / -type f -iname xxx It is only one c file in your source to modify. Code:
#include <SDL.h> Code:
Note: If you do not have the SDL_mixer library, or wish to not |
Quote:
but i just wanted to mention that the last time this package received any sort of update was 2009. a LOT has changed since then. compilers, libraries... there's also a precompiled version, maybe it works? |
All times are GMT -5. The time now is 06:39 PM. |