QJ.NET | Videos | Forums | iPhone | MMORPG | Nintendo DS | Wii | PlayStation 3 | PSP | Xbox 360 | PC | Downloads | Contact Us
Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact

QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides

Go Back   QJ.net Game Discussion - PSP, Xbox, Wii, PS3, PSP Homebrew, and PSP Guides > Developers Corner > PSP Development, Hacks, and Homebrew > PSP Development Forum
The above video goes away if you are a member and logged in, so log in now!

SDL error!

This is a discussion on SDL error! within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; I just installed SDL (no problem) but when I compile something I get /usr/local/pspdev/lib/gcc/psp/4.0.2../../../psp/lib/crt0.o in function '_main' /home/p.../pspsdk/src/startup/cr-.c:86: undefined reference ...

Reply
 
LinkBack Thread Tools
Old 04-30-2006, 11:40 PM   #1
 
ピッカホ's Avatar
 
Join Date: Jan 2006
Location: In a Dark land
Posts: 176
Trader Feedback: 0
Default SDL error!

I just installed SDL (no problem) but when I compile something I get

/usr/local/pspdev/lib/gcc/psp/4.0.2../../../psp/lib/crt0.o in function '_main'

/home/p.../pspsdk/src/startup/cr-.c:86: undefined reference to "main"

my makefile looks like this:
TARGET = hello
OBJS = Main.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDL GL

PSPSDK=$(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
CFLAGS += `$(PSPBIN)/sdl-config --cflags` -DHAVE_OPENGL
LIBS += -lglut -lGLU -lGL `$(PSPBIN)/sdl-config --libs` -lm -lc -lpspdebug -lpspge -lpspdisplay -lpspctrl -lpspsdk -lpspvfpu -lpspuser -lpspkernel -lstdc++
include $(PSPSDK)/lib/build.mak

thanks in advance!!
ピッカホ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-01-2006, 05:42 AM   #2
 
Join Date: Feb 2006
Posts: 12
Trader Feedback: 0
Default

I'm also fairly new to SDL. Actually I dropped it because I couldn't get the frames per second up to something decent, but I did get it to compile.

SDL defines it's own main() function. This function defines all the PSP specific callback and does some other init stuff and then calls a function called SDL_main(). SDL_main is the function that you should write as the "starting point" of your code. You should declare it something like
Code:
extern "C" int SDL_main( int argc, char *argv[] );
to keep the compiler from obfuscating your function names (so that SDL can find them).
codemonkey is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-01-2006, 09:48 AM   #3
Developer
 
BlackPhoenix's Avatar
 
Join Date: Dec 2005
Location: UK
Posts: 149
Trader Feedback: 0
Default

Here is how I did it
Code:
#ifndef PSP
int main(int argc, char *argv[])
#else
extern "C" int SDL_main(int argc, char *argv[])
#endif
{
//# etc etc..
}
BlackPhoenix is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-01-2006, 06:27 PM   #4
 
ピッカホ's Avatar
 
Join Date: Jan 2006
Location: In a Dark land
Posts: 176
Trader Feedback: 0
Default

hmm the compiler is still giving me errors with the same error message.
ピッカホ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-01-2006, 06:52 PM   #5

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

try main.o, instead of Main.o ... might be case sensitive?
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-01-2006, 07:31 PM   #6
 
ピッカホ's Avatar
 
Join Date: Jan 2006
Location: In a Dark land
Posts: 176
Trader Feedback: 0
Default

it gives me an sytax errir before sting constant. if I copy and paste extern "C" int SDL_main( int argc, char *argv[] ); (it doesn't like "C" in that line.) =c/
ピッカホ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-03-2006, 06:48 PM   #7
 
ピッカホ's Avatar
 
Join Date: Jan 2006
Location: In a Dark land
Posts: 176
Trader Feedback: 0
Default

*BUMP* does anybody have an idea on why its not compiling?
ピッカホ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-03-2006, 07:14 PM   #8

OMFG
 
Slasher's Avatar
 
Join Date: Jul 2005
Location: Toronto
Posts: 2,816
Trader Feedback: 0
Default

your using 'int SDL_main(int argc, char *argv[]) { }' as your main thread right? your not just using int main() { }
Slasher is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 05-03-2006, 10:23 PM   #9
 
ピッカホ's Avatar
 
Join Date: Jan 2006
Location: In a Dark land
Posts: 176
Trader Feedback: 0
Default

I can't use either because it will both give me the same thing =c/
ピッカホ is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
error , sdl

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



All times are GMT -8. The time now is 08:25 AM.



Use of this Web site constitutes acceptance of the TERMS & CONDITIONS and PRIVACY POLICY
Copyright © 2009, QJ.NET. All Rights Reserved.
Contact Us