forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Undefined reference to 'main'

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
BiB



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Thu Jul 22, 2004 8:34 pm    Post subject: Undefined reference to 'main' Reply with quote

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
View user's profile Send private message
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Thu Jul 22, 2004 9:50 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
BiB



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Thu Jul 22, 2004 11:40 pm    Post subject: Reply with quote

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
View user's profile Send private message
BiB



Joined: 27 Feb 2004
Posts: 36
Location: France

PostPosted: Fri Jul 23, 2004 12:57 am    Post subject: Reply with quote

That's OK now

I remake my makefile including makefile_sample from sdk and it works

Thanks
Back to top
View user's profile Send private message
blackdroid



Joined: 17 Jan 2004
Posts: 564
Location: Sweden

PostPosted: Fri Jul 23, 2004 1:41 am    Post subject: Reply with quote

goodie goodie tissue.
_________________
Kung VU
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group