Discuss the development of new homebrew software, tools and libraries.
Moderators: cheriff , TyRaNiD
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sat Sep 02, 2006 7:36 am
Alright, im trying to code using SDL, ill admit, im just trying to learn these things but whenver I try to use anything from SDL_mixer and SDL_image, it doesnt compile and just has errors...I initialized both using this code:
Code: Select all
/* Initialize SDL */
if ( SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO|SDL_INIT_JOYSTICK) < 0 ) {
fprintf(stderr, "Couldn't initialize SDL: %s\n",SDL_GetError());
return EXIT_FAILURE;
}
and , yeah its still having errors stating..
Undefined Reference to 'IMG_load'
and ect.
how can i verify I set up SDL_image and SDL_mixer properly?
thanks,
psiko
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sat Sep 02, 2006 7:56 am
I realized I forgot to add the libs to the makefile.....
now im getting another error....
error in function IMG_LoadBMP_RW - unspecifed reference to SDL_ReadLE32
and
error in function Mix_Channels - unspecified reference to SDL_mix_audio
and a bunch more...
any ideas?
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sat Sep 02, 2006 8:02 am
alright after a bit more tweaking, i realized that its now complaining about OGG files. I thought that if you installed LibTremor you didnt need to install OGG....eh, ill just get em all then right?
any suggestions?
Tinnus
Posts: 67 Joined: Sat Jul 29, 2006 1:12 am
Post
by Tinnus » Sat Sep 02, 2006 12:08 pm
You have to link your app with -lvorbisidec or something I think.
I've done that to try and play vorbis through SDL_mixer BTW but it simply didn't work. As in, did nothing. Compiled, linked, ran but didn't play the music...
If you get it to work please tell me what you did in the SDL/SDL_mixer/Tremor compiling process :)
Let's see what the PSP reserves... well, I'd say anything is better than Palm OS.
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sat Sep 02, 2006 3:34 pm
alright i got a majority of it to compile without errors...
but im now im getting a PNG error!!!
here is my Makefile, i think thats where my problem lies.
Code: Select all
TARGET = template
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lstdc++ -lc -lSDLmain -lSDL_ttf -lSDL_mixer -lvorbisidec -lSDL_gfx -lSDL_image -lz -lpng -lgl -ljpeg
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template
PSPBIN = $(PSPSDK)/../bin
CFLAGS += `$(PSPBIN)/sdl-config --cflags`
LIBS += `$(PSPBIN)/sdl-config --libs`
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
maybe im doing something wrong?
i followed the directions on this page:
http://feonix.dommel.be/eng%20tuts/translate01.htm
to isntall the SDK and SDL.
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sat Sep 02, 2006 4:06 pm
ok then, i think ive narrowed my problem down to an issue with
SDL_image.
i dont quite know what yet.
Wally
Posts: 663 Joined: Mon Sep 26, 2005 11:25 am
Post
by Wally » Sat Sep 02, 2006 4:26 pm
psiko_scweek wrote: alright i got a majority of it to compile without errors...
LIBS = -lstdc++ -lc -lSDLmain -lSDL_ttf -lSDL_mixer -lvorbisidec -lSDL_gfx -lSDL_image -lz -lpng -lgl -ljpeg
to isntall the SDK and SDL.
Would you by any chance have installed libPNG, LibJPG, LIBSDL_TTF, LIB GL?
If not download and install them from svn
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sat Sep 02, 2006 10:16 pm
Code: Select all
TARGET = template
PSPSDK = $(shell psp-config --pspsdk-path)
PSPPREFIX = $(shell psp-config --psp-prefix)
PSPBIN = $(PSPPREFIX)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
OBJS = main.o
DEFAULT_CFLAGS = $(shell $(SDL_CONFIG) --cflags)
MORE_CFLAGS = -g -O2 -fsingle-precision-constant -mno-check-zero-division #-ffast-math
CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
CXXFLAGS = -fno-exceptions
LIBDIR =
LIBS = -lSDL_mixer -lvorbisidec -lSDL_image -lz -lpng -ljpeg -lSDL_gfx -lm $(shell $(SDL_CONFIG) --libs)
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template
include $(PSPSDK)/lib/build.mak
ok, i changed a few things around. Its still not compling. It keeps stating that there are errors with LibPNG.
I have installed all the libs (not too sure about libGL) but everything else Ive installed. I think my problems are stemming from SDL_image.
I installed them all like i said using the website as a basis. Maybe I installed them wrong? is there anyway to un-install them?
lol
psiko
psiko_scweek
Posts: 42 Joined: Sat Nov 12, 2005 2:30 am
Post
by psiko_scweek » Sun Sep 03, 2006 11:24 am
Code: Select all
TARGET = game
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
OBJS = main.o
JOY = YES
CFLAGS = -Wall -Wno-long-long -O2 -G0 -DJOY_$(JOY)
CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
LIBS = -lSDL_mixer -lvorbisidec -lSDL_image -lpng -lz -ljpeg $(shell $(PSPBIN)/sdl-config --libs)
EXTRA_TARGETS = EBOOT.PBP
include $(PSPSDK)/lib/build.mak
compliled without problems.