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 

using C++

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



Joined: 23 Feb 2004
Posts: 2

PostPosted: Mon Feb 23, 2004 8:09 pm    Post subject: using C++ Reply with quote

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



Joined: 30 Jan 2004
Posts: 791

PostPosted: Mon Feb 23, 2004 8:54 pm    Post subject: Reply with quote

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



Joined: 25 Jan 2004
Posts: 155
Location: Annapolis, MD, USA

PostPosted: Mon Feb 23, 2004 11:19 pm    Post subject: Reply with quote

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



Joined: 23 Feb 2004
Posts: 2

PostPosted: Fri Feb 27, 2004 7:27 pm    Post subject: Reply with quote

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



Joined: 17 Jan 2004
Posts: 1536

PostPosted: Fri Feb 27, 2004 11:00 pm    Post subject: Reply with quote

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