LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 12-01-2018, 08:55 PM   #1
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 602

Rep: Reputation: 36
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

Last edited by sirius57; 12-01-2018 at 08:57 PM. Reason: need to include what linux distro is used
 
Old 12-01-2018, 09:00 PM   #2
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
look (install) for your developer headers, libSDL-dev or libSDL-devel or how ever your distro names them.
 
1 members found this post helpful.
Old 12-02-2018, 07:53 AM   #3
YesItsMe
Member
 
Registered: Oct 2014
Posts: 915

Rep: Reputation: 313Reputation: 313Reputation: 313Reputation: 313
On openSUSE, it's libSDL-devel.
 
1 members found this post helpful.
Old 12-02-2018, 02:39 PM   #4
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
yes, most distros make it whatever they want.
 
Old 12-12-2018, 08:29 PM   #5
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 602

Original Poster
Rep: Reputation: 36
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
 
Old 12-12-2018, 08:49 PM   #6
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
here is something on your distro and this issue?
https://forums.opensuse.org/showthre...to-on-openSUSE
 
Old 12-13-2018, 08:05 PM   #7
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 602

Original Poster
Rep: Reputation: 36
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?
 
Old 12-13-2018, 09:04 PM   #8
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
What application are you trying to compile?

That page I linked suggest using
Code:
pkg-config --cflags SDL2

so it might be something like 
g++ file.c pkg-config --cflags SDL2 -o app name
adding what else you use in that line as well. what is your make file?

Last edited by BW-userx; 12-13-2018 at 09:05 PM.
 
Old 12-16-2018, 07:03 PM   #9
sirius57
Member
 
Registered: Jun 2004
Distribution: puppy linux, suse 10.0, opensuse 11.3, 12.1, mythdora, opensuse 13.1, opensuse tumbleweed
Posts: 602

Original Poster
Rep: Reputation: 36
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
 
Old 12-16-2018, 07:57 PM   #10
BW-userx
LQ Guru
 
Registered: Sep 2013
Location: Somewhere in my head.
Distribution: Slackware (15 current), Slack15, Ubuntu studio, MX Linux, FreeBSD 13.1, WIn10
Posts: 10,342

Rep: Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242Reputation: 2242
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
using iname for no case senitive search, if you cannot find them, then do a wild card search for the files, they maybe under a name that is not exectly like it is looking for. If so, then just hack your code to make them match what you have on your system. that is what I'd do.

It is only one c file in your source to modify.
Code:
#include <SDL.h>

#ifndef NOSOUND
#include <SDL_mixer.h>
#endif /* #ifndef NOSOUND */
in the doc/INSTALL.txt
Code:
Note: If you do not have the SDL_mixer library, or wish to not
    compile sound support into the game, you can compile it like this:

        make nosound
I suggest you read INSTALL.txt and README.txt

Last edited by BW-userx; 12-16-2018 at 08:19 PM.
 
Old 12-17-2018, 01:52 AM   #11
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
Quote:
Originally Posted by sirius57 View Post
glad if you manage to compile it!
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?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
C: Minimalist SDL Presentation (SDL SDL_ttf) Xeratul Programming 0 12-23-2013 11:44 AM
SDL is installed, included and linked, but will not compile SDL code mansizerooster Programming 10 05-31-2006 04:18 AM
Sourcecompiling Problem...The sdl-config script installed by SDL could not be found. deepclutch Debian 1 12-15-2005 12:15 PM
include/linux/types.h and include/linux/posix_types.h kpachopoulos Programming 2 11-26-2005 05:52 AM
Trying to program an SDL application but cannot find the SDL.h file:SuSE 9.2&KDevelop pujolasdf Linux - Newbie 4 03-13-2005 07:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 08:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration