| View previous topic :: View next topic |
| Author |
Message |
btyla
Joined: 23 Feb 2004 Posts: 2
|
Posted: Mon Feb 23, 2004 8:09 pm Post subject: using C++ |
|
|
Hi,
Does the current tool chain support C++ development? I tried to some tutorial code and added a dummy C++ class, it all compiled without warning but LD was complaining about some undefined references about (my guess) low level vtable code (__register... __deregister...something).
Must I manual include some library code?
TIA |
|
| Back to top |
|
 |
pixel
Joined: 30 Jan 2004 Posts: 791
|
Posted: Mon Feb 23, 2004 8:54 pm Post subject: |
|
|
How did you compiled it ? Can you copy/paste explicit compilation and error messages ?
However, I just suppose you linked using "gcc" or "ld" directly, and not using "g++", which automagically links the "libstdc++.a" library in. _________________ pixel: A mischievous magical spirit associated with screen displays. The computer industry has frequently borrowed from mythology. Witness the sprites in computer graphics, the demons in artificial intelligence and the trolls in the marketing department. |
|
| Back to top |
|
 |
mharris
Joined: 25 Jan 2004 Posts: 155 Location: Annapolis, MD, USA
|
Posted: Mon Feb 23, 2004 11:19 pm Post subject: |
|
|
| From my experience, you need to add -fno-exceptions to the g++ command line -- exceptions don't seem to work, w/ my version of the toolchain at least. Exceptions are nasty, performance-robbing things (in c++ anyhow), and should be avoided. |
|
| Back to top |
|
 |
btyla
Joined: 23 Feb 2004 Posts: 2
|
Posted: Fri Feb 27, 2004 7:27 pm Post subject: |
|
|
This is the error message:
[quote]ee-gcc -Wall -W -EL -G0 -O0 -mips3 -nostdlib -DPS2_EE -Tlinkfile -o bin/demo1.elf obj/demo1.o obj/g2.o obj/crt0.o obj/dma_asm.o obj/gs_asm.o obj/ps2_asm.o obj/Object.o -Wl,-Map,demo1.elf.map
/DOCUME~1/x/LOCALS~1/Temp/ccC7DPCp.o: In function `reg_frame':
/DOCUME~1/x/LOCALS~1/Temp/ccT8TuTM.c(.text+0x20): undefined reference to `__register_frame_info_table'
/DOCUME~1/x/LOCALS~1/Temp/ccC7DPCp.o: In function `dereg_frame':
/DOCUME~1/x/LOCALS~1/Temp/ccT8TuTM.c(.text+0x58): undefined reference to `__deregister_frame_info'
collect2: ld returned 1 exit status
make: *** [bin/demo1.elf] Error 1[/quote] |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Fri Feb 27, 2004 11:00 pm Post subject: |
|
|
| btyla wrote: | This is the error message:
| Quote: | ee-gcc -Wall -W -EL -G0 -O0 -mips3 -nostdlib -DPS2_EE -Tlinkfile -o bin/demo1.elf obj/demo1.o obj/g2.o obj/crt0.o obj/dma_asm.o obj/gs_asm.o obj/ps2_asm.o obj/Object.o -Wl,-Map,demo1.elf.map
/DOCUME~1/x/LOCALS~1/Temp/ccC7DPCp.o: In function `reg_frame':
/DOCUME~1/x/LOCALS~1/Temp/ccT8TuTM.c(.text+0x20): undefined reference to `__register_frame_info_table'
/DOCUME~1/x/LOCALS~1/Temp/ccC7DPCp.o: In function `dereg_frame':
/DOCUME~1/x/LOCALS~1/Temp/ccT8TuTM.c(.text+0x58): undefined reference to `__deregister_frame_info'
collect2: ld returned 1 exit status
make: *** [bin/demo1.elf] Error 1 |
|
Add -fno-exceptions as mharris suggested, remove -nostdlib, or use ee-g++ instead of ee-gcc as pixel suggested. Take your pick. In the future you should read up on the compiler and linker options so that you know which option does what. Manuals are on the web or installed locally with the toolchain. |
|
| Back to top |
|
 |
|