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 

Compile rror (SDL): cannot find -lSDLmain

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



Joined: 20 Aug 2005
Posts: 16

PostPosted: Sat Aug 20, 2005 8:23 pm    Post subject: Compile rror (SDL): cannot find -lSDLmain Reply with quote

Code I wrote for the PSP without SDL runs fine...
All the SDL samples build and run fine...

But when I try to compile my program with SDL, I get the following error:
Code:
$ make
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/include/SDL
 -Dmain=SDL_main -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/in
clude/SDL -Dmain=SDL_main -fno-exceptions -fno-rtti   -c -o Main.o Main.cpp
psp-g++ -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/include/SDL
 -Dmain=SDL_main -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/in
clude/SDL -Dmain=SDL_main -fno-exceptions -fno-rtti   -c -o SDLGraphics.o SDLGra
phics.cpp
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -I/usr/include/SDL
 -Dmain=SDL_main  -L. -L/usr/local/pspdev/psp/sdk/lib   Main.o SDLGraphics.o -lS
DLmain -lSDL  -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspuser -
lpspkernel -o GPH_App2.elf
/usr/local/pspdev/lib/gcc/psp/4.0.1/../../../../psp/bin/ld: cannot find -lSDLmai
n
collect2: ld returned 1 exit status
make: *** [GPH_App2.elf] Error 1


Here is the makefile for my app:
Code:
TARGET          = GPH_App2
OBJS            = Main.o SDLGraphics.o

CFLAGS          = -O2 -G0 -Wall -I/usr/include/SDL -Dmain=SDL_main
CXXFLAGS        = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS         = $(CFLAGS)

LIBS            = -lSDLmain -lSDL

EXTRA_TARGETS   = EBOOT.PBP
PSP_EBOOT_ICON  = Data/Graphics/Icon0.png
PSP_EBOOT_PIC1  = Data/Graphics/Pic1.png
PSP_EBOOT_TITLE = GamePlayHeaven PSP App. 2

PSPSDK          =$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Does anyone have a clue what I'm doing wrong?
Back to top
View user's profile Send private message
rinco



Joined: 21 Jan 2005
Posts: 255
Location: Canberra, Australia

PostPosted: Sat Aug 20, 2005 10:00 pm    Post subject: Reply with quote

You do not have the -L for SDL.
This is done with the sdl-config command:

Quote:
matthewh$ /usr/local/pspdev/psp/bin/sdl-config --libs
-L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspaudio -lc -lpspuser -lpspkernel


You will see sdl-config used in all SDL app Makefiles.
Back to top
View user's profile Send private message
MadButch



Joined: 20 Aug 2005
Posts: 16

PostPosted: Sun Aug 21, 2005 1:00 am    Post subject: Reply with quote

I don't have a sdl-config in that dir.
I had to manually install SDL (128), because I can't seem to get it from the pspsdk.

Do I have to move the config file into that dir, or was I supposed to extract the SDL files from the pspsdk (toolchain) somehow?


EDIT:
I see the sdl-config file is in my bin dir in the root. But I looked for the .lib files, and I don't have those. So that must be whats wrong.
So I went back to the SDL site, and downloaded SDL-1.2.8-1.i386.rpm. But altho they got whole walkthroughs on how to run a setup.exe under windows, there is nothing on installing an rpm package.

No clue what I'm doing wrong... but this stuff is all made just a little bit too complicated for any normal person. It's like it's designed to be weird :)

Ah well.. someday I will have it set up and I can actually start coding =/
Back to top
View user's profile Send private message
mrbrown



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Sun Aug 21, 2005 3:39 am    Post subject: Reply with quote

You can't use i386 SDL for the PSP as they are binary incompatible. You need to check out SDL for PSP from the pspdev Subversion repository. Once you do, follow the instructions in README.PSP to build and install SDL for PSP.

The same goes for other PSP-specific ports of libraries such as zlib and libpng.
Back to top
View user's profile Send private message
MadButch



Joined: 20 Aug 2005
Posts: 16

PostPosted: Sun Aug 21, 2005 4:17 am    Post subject: Reply with quote

I've searched thru these forums, but I can't find any info on how to use that SVN site. I managed to find the SDL files in there, but I can't believe that I have to right click and Save As every single file in there....

There must be an easier way...

I already used the toolchain -p command to download and build the latest version, but that doesn't included any SDL files for me...

Would there be someplace/link where you could direct me to, that would explain how to use the SVN site?

EDIT:
Seems there is indeed, I found this works:
Code:
SVN checkout svn://svn.pspdev.org/psp/trunk/SDL
Back to top
View user's profile Send private message
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