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!

Cygwin compile errors...

This is a discussion on Cygwin compile errors... within the PSP Development Forum forums, part of the PSP Development, Hacks, and Homebrew category; Hi all, I am trying to compile my first non-tutorial PSP eboot but am getting problems with the following errors: ...

Reply
 
LinkBack Thread Tools
Old 09-06-2006, 08:11 AM   #1
 
Join Date: Feb 2006
Posts: 19
Trader Feedback: 0
Default Cygwin compile errors...

Hi all,

I am trying to compile my first non-tutorial PSP eboot but am getting problems with the following errors:

$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include/SDL -Dmain
=SDL_main -g -O2 -L. -L/usr/local/pspdev/psp/sdk/lib sound.o collide.o ball.o game.o me
nu.o player.o randgen.o init.o main.o -lsdl_ttf -logg -lvorbisidec -lsdl_mixer -lz -lfreet
ype -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspd
ebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lp
spuser -lpsputility -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lp
spnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o
pong.elf
game.o: In function `loadImages()':
/home/DeanHillier/projects/pong/game.cpp:415: undefined reference to `IMG_Load'
/home/DeanHillier/projects/pong/game.cpp:422: undefined reference to `IMG_Load'
menu.o: In function `showMenu()':
/home/DeanHillier/projects/pong/menu.cpp:15: undefined reference to `IMG_Load'
/home/DeanHillier/projects/pong/menu.cpp:23: undefined reference to `IMG_Load'
/usr/local/pspdev/psp/lib/libsdl_mixer.a(music_ogg. o): In function `OGG_new':
/home/DeanHillier/sdl_mixer/music_ogg.c:74: undefined reference to `ov_open'
/usr/local/pspdev/psp/lib/libsdl_mixer.a(music_ogg. o): In function `OGG_new_RW':
/home/DeanHillier/sdl_mixer/music_ogg.c:126: undefined reference to `ov_open_callbacks'
/usr/local/pspdev/psp/lib/libsdl_mixer.a(music_ogg. o): In function `OGG_getsome':
/home/DeanHillier/sdl_mixer/music_ogg.c:159: undefined reference to `ov_read'
/home/DeanHillier/sdl_mixer/music_ogg.c:173: undefined reference to `ov_info'
/usr/local/pspdev/psp/lib/libsdl_mixer.a(music_ogg. o): In function `OGG_delete':
/home/DeanHillier/sdl_mixer/music_ogg.c:237: undefined reference to `ov_clear'
/usr/local/pspdev/psp/lib/libsdl_mixer.a(music_ogg. o): In function `OGG_jump_to_time':
/home/DeanHillier/sdl_mixer/music_ogg.c:245: undefined reference to `ov_time_seek'
/usr/local/pspdev/psp/lib/libsdl_mixer.a(load_ogg.o ): In function `Mix_LoadOGG_RW':
/home/DeanHillier/sdl_mixer/load_ogg.c:93: undefined reference to `ov_open_callbacks'
/home/DeanHillier/sdl_mixer/load_ogg.c:93: undefined reference to `ov_open_callbacks'
/home/DeanHillier/sdl_mixer/load_ogg.c:101: undefined reference to `ov_info'
/home/DeanHillier/sdl_mixer/load_ogg.c:112: undefined reference to `ov_pcm_total'
/home/DeanHillier/sdl_mixer/load_ogg.c:122: undefined reference to `ov_read'
/home/DeanHillier/sdl_mixer/load_ogg.c:128: undefined reference to `ov_read'
/home/DeanHillier/sdl_mixer/load_ogg.c:140: undefined reference to `ov_clear'
/usr/local/pspdev/psp/lib/libSDLmain.a(SDL_psp_main .o): In function `main':
psp/SDL_psp_main.c:178: undefined reference to `SDL_main'
collect2: ld returned 1 exit status
make: *** [pong.elf] Error 1


The sdl_mixer issues are bugging me the most. As far as I am aware the lib is correctly installed. Also need help with the IMG_Load and SDL_main errors.

Thanks in advance!
MilitiaArise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2006, 03:34 PM   #2
likes kittens....awww....
 
Join Date: Sep 2006
Real First Name: Erik
Location: Detroit
Just Played: Call of Duty:World at War
Posts: 628
Trader Feedback: 0
Default

i like lua because its just simple text files
psphacker12. is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-06-2006, 03:39 PM   #3

...in a dream...
 
SG57's Avatar
 
Join Date: Jul 2005
Posts: 4,957
Trader Feedback: 0
Default

psphacker12 - Quit trolling. That had no relativity to the problem.

MilitiaArise - Post your makefile, as it looks like your not linking libOGG/libVorbis/libTremor (whichever SDL uses....) and SDL_image correctly.
__________________
SG57 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-08-2006, 01:36 AM   #4
 
Join Date: Feb 2006
Posts: 19
Trader Feedback: 0
Default Makefile

Hi SG57,

My makefile is as follows:

TARGET = pong
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(shell psp-config --psp-prefix)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
O = o
OBJS=sound.o collide.o ball.o game.o menu.o player.o randgen.o init.o main.o


DEFAULT_CFLAGS = $(shell $(SDL_CONFIG) --cflags)

MORE_CFLAGS = -g -O2

CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
CXXFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS) -fno-exceptions

LIBS = -lsdl_ttf -logg -lvorbisidec -lvorbis -lsdl_mixer -lz -lfreetype $(shell $(SDL_CONFIG) --libs)


EXTRA_TARGETS = EBOOT.PBP

include $(PSPSDK)/lib/build.mak


I have played around with various settings but no joy!

Cheers for taking the time to reply.

Anyone able to shed some light?

Last edited by MilitiaArise; 09-11-2006 at 02:17 AM..
MilitiaArise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 02:19 AM   #5
 
Join Date: Feb 2006
Posts: 19
Trader Feedback: 0
Default

Just wanted to bring this back up. Anyone got an idea where i'm going wrong?

Thanks
MilitiaArise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 03:01 AM   #6
 
Join Date: Jul 2006
Posts: 53
Trader Feedback: 0
Default

Start with the first error: "undefined reference to `IMG_Load'"

This is telling you that the IMG_Load function doesn't exist in your code or in a linked library. You'll need to figure out which library to link. Type the following command at the cygwin prompt:
Code:
$ find /usr/local/pspdev -type f -name "*.a"|xargs strings --print-file-name|grep IMG_Load
If you get a filename, that's the library you need to add to your makefile. If you don't get any results it means you need a library you don't have installed and will require more research to figure out what you're missing.
СУББОТА is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 03:42 AM   #7

Cool Developer
 
Sturmeh's Avatar
 
Join Date: Nov 2005
Location: Australia
Posts: 1,301
Trader Feedback: 0
Default

pfft lua dosn't even print more than one error at a time...

Clearly you havnt included the OggVorbis in ur makefile, and some sort of image render. thru im not competent enough to put them in for you. :P

Good luck with it, ive never received such a long error...
__________________
Hmm...
Sturmeh is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 08:01 AM   #8
 
Join Date: Feb 2006
Posts: 19
Trader Feedback: 0
Default

OK, cool. So far so good. I'm down to just the one now - SDL_main.

The find command you gave me brings up:

/usr/local/pspdev/psp/lib/libSDLmain.a: SDL_main

I have added -lsdlmain to the makefile but nothing has changed.

The error now looks like this:

$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include/SDL -Dmain
=SDL_main -g -O2 -L. -L/usr/local/pspdev/psp/sdk/lib sound.o collide.o ball.o game.o menu.o player.o randgen.o init.o main.o -lsdl_image -lpng -lsdl_mixer -lsdl_ttf -logg -lvorbisidec -lvorbis -lz -lfreetype -lsdlmain -L/usr/local/pspdev/psp/lib -lSDLmain -lSDL -lm -L/usr/local/pspdev/psp/sdk/lib -lpspdebug -lpspgu -lpspctrl -lpspge -lpspdisplay -lpsphprm -lpspsdk -lpsprtc -lpspaudio -lc -lpspuser -lpsputility -lpspkernel -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o pong.elf
/usr/local/pspdev/psp/lib/libsdlmain.a(SDL_psp_main .o): In function `main':
psp/SDL_psp_main.c:178: undefined reference to `SDL_main'
collect2: ld returned 1 exit status
make: *** [pong.elf] Error 1


And my current makefile is:

TARGET = pong
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(shell psp-config --psp-prefix)/bin
SDL_CONFIG = $(PSPBIN)/sdl-config
O = o
OBJS=sound.o collide.o ball.o game.o menu.o player.o randgen.o init.o main.o


DEFAULT_CFLAGS = $(shell $(SDL_CONFIG) --cflags)

MORE_CFLAGS = -g -O2

CFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS)
CXXFLAGS = $(DEFAULT_CFLAGS) $(MORE_CFLAGS) -fno-exceptions

LIBS = -lsdl_image -lpng -lsdl_mixer -lsdl_ttf -logg -lvorbisidec -lvorbis -lz -lfreetype -lsdlmain $(shell $(SDL_CONFIG) --libs)


EXTRA_TARGETS = EBOOT.PBP

include $(PSPSDK)/lib/build.mak
MilitiaArise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 08:07 AM   #9

AKA Homer
 
Moonchild's Avatar
 
Join Date: Jan 2006
Location: Sweden
Posts: 1,779
Trader Feedback: 0
Default

Don't you have to add -lsdl to your libs too?
__________________


Click Here if you want a Winamp Currently Playing Userbar like the one above.
Moonchild is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 08:18 AM   #10
 
Join Date: Feb 2006
Posts: 19
Trader Feedback: 0
Default

Yeah, I did have them all declared but if you read all that stuff that spews out after you type MAKE, it seems to be declared anyway. I can only assume that is due to $(shell $(SDL_CONFIG) --libs).

Anyway, I tried it just in case and no joy...
MilitiaArise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-11-2006, 12:31 PM   #11
 
Join Date: Jul 2006
Posts: 53
Trader Feedback: 0
Default

I think you want -lSDLmain. I'd expect it to be case-sensitive.
СУББОТА is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-12-2006, 03:21 AM   #12
 
Join Date: Feb 2006
Posts: 19
Trader Feedback: 0
Default

Case didn't make a difference. I have also tried reinstalling the SDL lib. Nothing.

This affects all projects I try to compile. Same error. I've googled it and searched the forum. Other people have had the same error but received no answers.

EDIT!!!

OK, after a bit of research and after successfully compiling someone elses work, I have come to the conclusion that I have something wrong with my main.cpp file. Any ideas?

#include <stdio.h>
#include <zlib.h>
#include "SDL.h"

#include <pspkernel.h>
#include <pspdebug.h>
#include <pspsdk.h>
#include <pspctrl.h>
#include <pspthreadman.h>
#include <stdlib.h>
#include <stdio.h>
#include "gamedefs.h"
#include "randgen.h"
#include "init.h"
#include "menu.h"
#include "game.h"


int main(int argc, char *argv[])
{
/* set up the random seed generator */
initRandom();

int result;
result = initGame();
if (result != 0) {
printf("Some errors occurred during initialization.\n");
return 1;
}

/* Start of super main loop */
while (numPlayers != 0)
{
showMenu(); /* Show menu, which sets numPlayers */
if (numPlayers != 0) { startGame(); } /* Start the game! */
} /* End the super main loop */

quitGame();

printf("Battle Pong is exiting normally.\n");
return 0;
}

-= Double Post =-
OK, Sorry for the double post.

No doubt i was doing something pretty dumb. Anyway, I managed to sort it. It was to do with the main.cpp. I copied this from ZX81's PSPAtari into my main.cpp before the int main() -

#define STDOUT_FILE "stdout.txt"
#define STDERR_FILE "stderr.txt"

extern int SDL_main(int argc, char *argv[]);

static void cleanup_output(void);

PSP_MODULE_INFO("PSPAtari ", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(THRE AD_ATTR_USER | THREAD_ATTR_VFPU);

int
sdl_psp_exit_callback(int arg1, int arg2, void *common)
{
cleanup_output();
sceKernelExitGame();
return 0;
}

int sdl_psp_callback_thread(S ceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback(" Exit Callback",
sdl_psp_exit_callback, NULL);
sceKernelRegisterExitCall back(cbid);

sceKernelSleepThreadCB();
return 0;
}

int sdl_psp_setup_callbacks(v oid)
{
int thid = 0;

sceCtrlSetSamplingCycle(0 );
sceCtrlSetSamplingMode(PS P_CTRL_MODE_ANALOG);

thid = sceKernelCreateThread("up date_thread",
sdl_psp_callback_thread, 0x11, 0xFA0, 0, 0);
if(thid >= 0)
sceKernelStartThread(thid , 0, 0);
return thid;
}

void sdl_psp_exception_handler (PspDebugRegBlock *regs)
{
pspDebugScreenInit();

pspDebugScreenSetBackColo r(0x00FF0000);
pspDebugScreenSetTextColo r(0xFFFFFFFF);
pspDebugScreenClear();

pspDebugScreenPrintf("I regret to inform you your psp has just crashed\n\n");
pspDebugScreenPrintf("Exc eption Details:\n");
pspDebugDumpException(reg s);
pspDebugScreenPrintf("\nT he offending routine may be identified with:\n\n"
"\tpsp-addr2line -e target.elf -f -C 0x%x 0x%x 0x%x\n",
regs->epc, regs->badvaddr, regs->r[31]);
}

/* Remove the output files if there was no output written */
static void cleanup_output(void)
{
#ifndef NO_STDIO_REDIRECT
FILE *file;
int empty;
#endif

/* Flush the output in case anything is queued */
fclose(stdout);
fclose(stderr);

#ifndef NO_STDIO_REDIRECT
/* See if the files have any output in them */
file = fopen(STDOUT_FILE, "rb");
if ( file ) {
empty = (fgetc(file) == EOF) ? 1 : 0;
fclose(file);
if ( empty ) {
remove(STDOUT_FILE);
}
}
file = fopen(STDERR_FILE, "rb");
if ( file ) {
empty = (fgetc(file) == EOF) ? 1 : 0;
fclose(file);
if ( empty ) {
remove(STDERR_FILE);
}
}
#endif
}

extern void _fini(void);

#ifdef main
#undef main
#endif


So all I have to do now is actually

Last edited by MilitiaArise; 09-12-2006 at 03:21 AM.. Reason: Automerged Doublepost
MilitiaArise is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
compile , cygwin , errors

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 09:56 AM.



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