[in-charge] [not-in-charge] problems linking C++ files
Posted: Fri May 02, 2008 10:13 am
Hey guys. I'm having a problem with compiling code. I have browsed the threads about compiling, but most of them are two to three years old and don't really supply much help. I have had no problems getting C code to compile and link, but I am having major problems getting C++ code to link. I have messed around with the Makefiles and gotten it to the point where I have hit a brick wall. It appears that the compiler recognizes the classes, but when a call is made to their functions, it doesn't like it and gives me this error.
So what is up with the whole "[in-charge]" "[not-in-charge]" thing??? I did some Google searches, but they all came back saying something like "you probably have a linking error" which I already know. How can I fix this? If you want to see my makefile:
MAKEFILE
Code: Select all
ee-gcc -mno-crt0 -T/usr/local/ps2dev/ps2sdk/ee/startup/linkfile -L/usr/local/ps2dev/ps2sdk/ee/lib \
-o pclis.elf /usr/local/ps2dev/ps2sdk/ee/startup/crt0.o linked_list.o tokenizer.o shell.o pclis.o -lkbd -ldebug -lstdc++ -lc -lkernel
shell.o(.text+0x10): In function `Shell::Shell[not-in-charge]()':
shell.cc: undefined reference to `Tokenizer::Tokenizer[in-charge]()'
shell.o(.text+0x64):shell.cc: undefined reference to `Tokenizer::~Tokenizer [in-charge]()'
shell.o(.text+0x88): In function `Shell::Shell[in-charge]()':
shell.cc: undefined reference to `Tokenizer::Tokenizer[in-charge]()'
shell.o(.text+0xdc):shell.cc: undefined reference to `Tokenizer::~Tokenizer [in-charge]()'
shell.o(.text+0x10c): In function `Shell::~Shell [not-in-charge]()':
shell.cc: undefined reference to `Tokenizer::~Tokenizer [in-charge]()'
shell.o(.text+0x144): In function `Shell::~Shell [in-charge]()':
shell.cc: undefined reference to `Tokenizer::~Tokenizer [in-charge]()'
collect2: ld returned 1 exit status
make: *** [pclis.elf] Error 1
MAKEFILE
Code: Select all
EE_BIN = pclis.elf
EE_OBJS = linked_list.o tokenizer.o shell.o pclis.o
EE_LIBS = -lkbd -ldebug -lstdc++
all: $(EE_BIN)
clean:
rm -f *.o *.elf *.a
include $(PS2SDK)/samples/Makefile.pref
include $(PS2SDK)/samples/Makefile.eeglobal