forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Inizializing SDL

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sat Sep 02, 2006 7:36 am    Post subject: Inizializing SDL Reply with quote

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:
   /* 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..

Quote:
Undefined Reference to 'IMG_load'
and ect.

how can i verify I set up SDL_image and SDL_mixer properly?

thanks,
psiko
Back to top
View user's profile Send private message Yahoo Messenger
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sat Sep 02, 2006 7:56 am    Post subject: oook then. Reply with quote

I realized I forgot to add the libs to the makefile.....

now im getting another error....

Quote:
error in function IMG_LoadBMP_RW - unspecifed reference to SDL_ReadLE32


and

Quote:
error in function Mix_Channels - unspecified reference to SDL_mix_audio


and a bunch more...

any ideas?
Back to top
View user's profile Send private message Yahoo Messenger
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sat Sep 02, 2006 8:02 am    Post subject: ook...then again! Reply with quote

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?
Back to top
View user's profile Send private message Yahoo Messenger
Tinnus



Joined: 29 Jul 2006
Posts: 67

PostPosted: Sat Sep 02, 2006 12:08 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sat Sep 02, 2006 3:34 pm    Post subject: gah!!!! Reply with quote

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:
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.
Back to top
View user's profile Send private message Yahoo Messenger
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sat Sep 02, 2006 4:06 pm    Post subject: Reply with quote

ok then, i think ive narrowed my problem down to an issue with

SDL_image.

i dont quite know what yet.
Back to top
View user's profile Send private message Yahoo Messenger
Wally



Joined: 26 Sep 2005
Posts: 672

PostPosted: Sat Sep 02, 2006 4:26 pm    Post subject: Re: gah!!!! Reply with quote

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
Back to top
View user's profile Send private message AIM Address
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sat Sep 02, 2006 10:16 pm    Post subject: hmm... Reply with quote

Code:
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
Back to top
View user's profile Send private message Yahoo Messenger
psiko_scweek



Joined: 12 Nov 2005
Posts: 42

PostPosted: Sun Sep 03, 2006 11:24 am    Post subject: lol ok i think i got it Reply with quote

Code:
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.
Back to top
View user's profile Send private message Yahoo Messenger
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group