| View previous topic :: View next topic |
| Author |
Message |
gambiting
Joined: 17 Aug 2006 Posts: 154
|
Posted: Sun Jan 13, 2008 8:25 am Post subject: Very weird compilation error |
|
|
Hi! I can't compile my SDL game for PSP(it's a port of my own game for PC). Error I have is:
| Code: | gambiting@gambiting-desktop:~/psp/v-pop_psp$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -I/usr/local/pspdev/psp/include/SDL -Dmain=SDL_main -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib main.o -lpsprtc -lstdc++ -lc -lm -lz -lSDL -lSDLmain -lSDL_ttf -lSDL_gfx -lfreetype -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 -lpspnet_inet -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o V-POP.elf
/usr/local/pspdev/psp/lib/libSDLmain.a(SDL_psp_main.o): In function `cleanup_output':
psp/SDL_psp_main.c:122: multiple definition of `module_info'
main.o:/home/gambiting/psp/v-pop_psp/main.cpp:109: first defined here
/usr/local/pspdev/psp/lib/libSDLmain.a(SDL_psp_main.o): In function `cleanup_output':
psp/SDL_psp_main.c:122: multiple definition of `sce_newlib_attribute'
main.o:/home/gambiting/psp/v-pop_psp/main.cpp:109: first defined here
collect2: ld returned 1 exit status
make: *** [V-POP.elf] Error 1
gambiting@gambiting-desktop:~/psp/v-pop_psp$ |
It's very weird,as on line 109 in main.cpp file there is no such functions,only my own code,which is nowhere near related to SDL.My makefile:
| Code: | TARGET = V-POP
SOURCES = main.cpp
OBJS = main.o
YOURLIBS=
INCDIR =
CXX = psp-g++
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti -g -G4 -Wall -O2 -G0 -Wall -D_DEBUG -DPSPDevkit -DPSP_FW_VERSION=371
ASFLAGS = $(CFLAGS)
SDL_CONFIG = $(PSPBIN)/sdl-config
USE_PSPSDK_LIBC=1
LIBDIR =
LDFLAGS =
STDLIBS= -lpsprtc -lstdc++ -lc -lm -lz -lSDL -lSDLmain -lSDL_ttf -lSDL_gfx -lfreetype
LIBS=$(STDLIBS)$(YOURLIBS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = V-POP
PSPSDK=$(shell psp-config --pspsdk-path)
PSPBIN = $(PSPSDK)/../bin
CFLAGS += $(shell $(PSPBIN)/sdl-config --cflags)
LIBS += $(shell $(PSPBIN)/sdl-config --libs)
include $(PSPSDK)/lib/build.mak | It's very stupid error,so I guess that's my mistake somewhere,and it will be easy to find.Please help :D |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Sun Jan 13, 2008 10:20 am Post subject: |
|
|
What is at line 109?
We can't guess if you won't show us, but you probably have some PSP_* macros that are conflicting with the ones in libSDLmain. Use one or the other, not both. |
|
| Back to top |
|
 |
Chrighton
Joined: 15 Jun 2005 Posts: 58
|
Posted: Sun Jan 13, 2008 11:22 am Post subject: |
|
|
That's exactly the problem, you're linking to SDL_main which has been built using those macros. Don't link to it if you want to use the macros in your stuff, or omit them if you do link to SDL_main.
Also, you may want to consider dropping SDL_main if you you plan on some level of compatibility with the slim psp. |
|
| Back to top |
|
 |
gambiting
Joined: 17 Aug 2006 Posts: 154
|
Posted: Sun Jan 13, 2008 8:17 pm Post subject: |
|
|
| Hi! On line 109 there was my function void Draw_Box,but I figured it out - SDLmain uses it's own PSP_MODULE_INFO functions,so I couldn't use them in my own source file.But they were on line 6 and 7 so I don't know why compiler was telling me that they are on line 109...strange.Also,I removed SDLmain for now,as it wouldn't work with slim.Everything is solved.Thanks very much! |
|
| Back to top |
|
 |
|