| View previous topic :: View next topic |
| Author |
Message |
NovaCaine
Joined: 20 Dec 2005 Posts: 34 Location: New Zealand
|
Posted: Tue Jan 17, 2006 9:32 am Post subject: Errors compiling SDL |
|
|
Hey all,
Trying to get my head around how to compile with makefiles, had it working until I rebooted and cant figure out what I've missed.
Basically I've converted a SDL app I'd made to run on my PSP, but when I compile it i get errors about "undefined reference to SDL_RWFromFile" in SDL_image/IMG.c along with a bunch of others in the SDL library. I know its not a bug in their code so what have i missed
I'm currently using this as my makefile:
| Code: |
TARGET = hello
OBJS = Main.o Application.o TilePlotter.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Hello World
PSPSDK=$(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
CFLAGS += `$(PSPBIN)/sdl-config --cflags`
LIBS += `$(PSPBIN)/sdl-config --libs` -lSDL_image -lpng -lz -ljpeg -lm -lstdc++
include $(PSPSDK)/lib/build.mak |
EDIT: Hmmm, ok this is really weird.
If I leave in my keyboard code from when it was a PC app it compiles fine, but if I comment it out I get errors? any ideas? _________________ My work:
TrackBundler for Gripshift |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Tue Jan 17, 2006 9:49 am Post subject: Re: Errors compiling SDL |
|
|
| NovaCaine wrote: | | Code: | | LIBS += `$(PSPBIN)/sdl-config --libs` -lSDL_image -lpng -lz -ljpeg -lm -lstdc++ |
|
Move SDL_image before the sdl-config part. Link order matters when linking statically as we do on the psp. |
|
| Back to top |
|
 |
NovaCaine
Joined: 20 Dec 2005 Posts: 34 Location: New Zealand
|
Posted: Tue Jan 17, 2006 10:01 am Post subject: |
|
|
thx for that, the whole makefile thing is new to me (usually a windows programmer) _________________ My work:
TrackBundler for Gripshift |
|
| Back to top |
|
 |
MikeDX
Joined: 19 Oct 2005 Posts: 30
|
Posted: Tue Jan 17, 2006 10:10 pm Post subject: |
|
|
| NovaCaine wrote: | | thx for that, the whole makefile thing is new to me (usually a windows programmer) |
it shows ;) |
|
| Back to top |
|
 |
|