Sdl Compile Probs.


MadDog

Member
Joined
Mar 4, 2006
Messages
262
Age
54
Location
UK
Website
www.maddoggames.com
I'm a bit new at this Linux lark, although I do know a lot about console development. So forgive my posible simple question.

I've set up Dev C++, the tut in the Wiki worked a treat. I've got the sdl test prog and downloaded the SDL-1.2.9-GP2X-0225 version of SDL.

I've been spending the last two days reading all the posts and i've not found anything saying where it should all go, the dir struct is a bit alien to me not being a Linux user. Anyway, I copied the header folder from the SDL I downloaded and added the include path. The compiler now finds the sdl.h but sdl_ttf.h is missing. Have to got the correct sdl?

Also the libs seem to be missing, i'm use to SDK's having an include and libs folder.

Is there a noob start to finish (sdl test compiled and running on gp2x) doc about to help me.


Thanks guys, i'm use to compiler setup being a bit painfull having work on sony hardware for years. ;)
I'm very excited about starting gp2x dev. :)

I'm going to carry on with google to see if I can find a fix.
 
Thanks for the reply Mr.Jabberwocky, but i've read that one. This post like the others assume an SDL folder is in the include. But the sdk I have has no SDL in it al all. :( Which is why I downloaded SDL-1.2.9-GP2X-0225.
For the sdk I downloaded "devkitGP2X-win32.exe", did I get the wrong one?

I've found another download with some of the sdl bit's i'm missing but I can't help thinking i'm 'hacking' it together.

I would imagine there is some kind of legal issue or something else why it all don't come together in one package. I just need a FAQ that lists what bits I need, where to get them and where to put them.

More googling. ;)
 
MadDog posted on Mar 12 2006 at 03:32 PM said:
I'm a bit new at this Linux lark, although I do know a lot about console development. So forgive my posible simple question.

I've set up Dev C++, the tut in the Wiki worked a treat. I've got the sdl test prog and downloaded the SDL-1.2.9-GP2X-0225 version of SDL.

I've been spending the last two days reading all the posts and i've not found anything saying where it should all go, the dir struct is a bit alien to me not being a Linux user. Anyway, I copied the header folder from the SDL I downloaded and added the include path. The compiler now finds the sdl.h but sdl_ttf.h is missing. Have to got the correct sdl?

Also the libs seem to be missing, i'm use to SDK's having an include and libs folder.
Did you just download the pre-comiled SDL? That version is meant for people who have already installed SDL and so don't need to re-download all the includes etc. If you've got the source, you need to run ./configure, make, and make install. Basic instructions should be in README.GP2X of the source download.
SDL_ttf.h isn't part of the core SDL, it's a header from a seperate library which you'll need to download.
 
Last edited by a moderator:
Thanks Critical, thats the magic link i've been looking for, now to fix my link errors. ;) But thats cool I've seen some fixes for these on the forum.
 
perhaps you need to edit your makefile.. here a example of o makefile

Code:
CROSS_COMPILE = c:/devkitGP2X/bin/arm-linux-
SDL_BASE = C:/devkitGP2X/bin/arm-linux-
LDFLAGS = -static

CC = $(CROSS_COMPILE)gcc
CXX = $(CROSS_COMPILE)g++
STRIP = $(CROSS_COMPILE)strip

CFLAGS = `$(SDL_BASE)sdl-config --cflags` -O2 -Wall
CXXFLAGS = `$(SDL_BASE)sdl-config --cflags` -O2 -Wall 
LIBS = `$(SDL_BASE)sdl-config --libs` -lSDL_ttf -lSDL_image -lpng12 -lz

SDLTEST_TARGET := \
	demo.gpe 
	
SDLTEST_OBJS := \
[B]	demo.o \
	Collision.o \
	DrawStuff.o \
	SDL_rotozoom.o \
	unrarlib.o[/B]

all : $(SDLTEST_TARGET)

$(SDLTEST_TARGET) : $(SDLTEST_OBJS)
	$(CXX) $(LDFLAGS) -o $(SDLTEST_TARGET) $(SDLTEST_OBJS) $(LIBS) 
	$(STRIP) $(SDLTEST_TARGET)
	echo XXX1 $(CXX) $(LDFLAGS) -o $(SDLTEST_TARGET) $(SDLTEST_OBJS) $(LIBS) 
	echo XXX2 $(STRIP) $(SDLTEST_TARGET)

clean:
	rm -f $(ALL_TARGETS) *.o *~

it will generate demo.gpe, from my source files (bold). this section is important

LIBS = `$(SDL_BASE)sdl-config --libs` -lSDL_ttf -lSDL_image -lpng12 -lz

the file arm-linux-sdl-config will create the include stuff (path to sdl headers an libs)


cheers
 
Back
Top