| View previous topic :: View next topic |
| Author |
Message |
BiB
Joined: 27 Feb 2004 Posts: 36 Location: France
|
Posted: Thu Jul 22, 2004 8:34 pm Post subject: Undefined reference to 'main' |
|
|
When i compile i have Undefined reference to 'main' in file crt0.o (function _exit)
What's wrong ??? I checked my c file and there is a main function |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Thu Jul 22, 2004 9:50 pm Post subject: |
|
|
apparently you are not giving gcc the source or object files needed for compiling properly, how do you invoke gcc ? ( you could paste your eventual Makefile ). _________________ Kung VU |
|
| Back to top |
|
 |
BiB
Joined: 27 Feb 2004 Posts: 36 Location: France
|
Posted: Thu Jul 22, 2004 11:40 pm Post subject: |
|
|
Yesterday night i made it working but i unfortunately i deleted my directory :S
Here ismy makefile :
include $(PS2SDK)/Makefile.eeglobal
EE_NAME = ps2shell
EE_C = $(EE_NAME).c
EE_O = $(EE_NAME).o
EE_ELF = $(EE_NAME).elf
EE_INCS += -I$(PS2SDK)/ee/rpc/keyboard/include
EE_LIB += -L$(PS2SDK)/ee/rpc/keyboard/lib
EE_LIBS += -lkbd
all: $(EE_O)
ee-g++ $(EE_FLAGS) $(EE_INCS) $(EE_LIB) -o $(EE_ELF) $(EE_OBJS) $(EE_LIBS)
$(EE_O): $(EE_C)
ee-g++ $(EE_FLAGS) $(EE_INCS) $(EE_LIB) -c $(EE_C)
clean:
rm *.elf *.o
and here is the Makefile.eeglobal from ps2sdk ( i modified it)
EE_INCS = -I$(PS2DEV)/ee/ee/include -I$(PS2SDK)/ee/kernel/include -I$(PS2SDK)/ee/libc/include -I$(PS2SDK)/common/include -I$(PS2DEV)/ee/ee/include -Iinclude -I$(PS2SDK)/ee/debug/include
EE_LIB = -L$(PS2SDK)/ee/libc/lib -L$(PS2SDK)/ee/debug/lib -L$(PS2SDK)/ee/kernel/lib -L$(PS2DEV)/ee/ee/lib
EE_LIBS = -lc -lkernel -ldebug -lsyscall
EE_FLAGS = -nostartfiles -T$(PS2SDK)/ee/startup/linkfile -D_EE -O2 -G0 -Wall
EE_OBJS = $(PS2SDK)/ee/startup/obj/crt0.o $(PS2SDK)/ee/libc/obj/vsnprintf.o $(PS2SDK)/ee/libc/obj/sbrk.o $(PS2SDK)/ee/libc/obj/putchar.o $(PS2SDK)/ee/libc/obj/memcpy.o $(PS2SDK)/ee/libc/obj/strncpy.o |
|
| Back to top |
|
 |
BiB
Joined: 27 Feb 2004 Posts: 36 Location: France
|
Posted: Fri Jul 23, 2004 12:57 am Post subject: |
|
|
That's OK now
I remake my makefile including makefile_sample from sdk and it works
Thanks |
|
| Back to top |
|
 |
blackdroid
Joined: 17 Jan 2004 Posts: 564 Location: Sweden
|
Posted: Fri Jul 23, 2004 1:41 am Post subject: |
|
|
goodie goodie tissue. _________________ Kung VU |
|
| Back to top |
|
 |
|