![]() |
| Forums | Gaming News | Videos | Downloads | Today's Posts | Mark Forums Read | Chat | FAQ | Members List | Contact |
| ||||||
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: ...
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
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! |
|
|
|
|
|
|
#3 |
![]() ![]() ...in a dream...
|
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.
__________________
...you'll never know what it's like... spending your whole life in a dream...
Launch a Kitten out of a Cannon and win real cash! Checkout my newly updated site for all my projects (Kitten Cannon, BOXHEAD, Light Cycle 3D) |
|
|
|
|
|
#4 |
|
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.. |
|
|
|
|
|
|
#6 |
![]() |
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 |
|
|
|
|
|
#7 |
![]() ![]() Cool Developer
|
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... |
|
|
|
|
|
#8 |
|
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 |
|
|
|
|
|
|
#9 |
![]() ![]() AKA Homer
|
Don't you have to add -lsdl to your libs too?
|
|
|
|
|
|
#10 |
|
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... |
|
|
|
|
|
|
#12 |
|
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 |
|
|
|
|
![]() |
| Tags |
| compile , cygwin , errors |
| Thread Tools | |
|
|