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 

Link error when using C++ exceptions (try-catch)

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



Joined: 31 Dec 2005
Posts: 15

PostPosted: Sun Jan 01, 2006 12:20 am    Post subject: Link error when using C++ exceptions (try-catch) Reply with quote

I read somewhere on this forums that try-catch was supported, but when I try to compile with C++ exceptions enabled, I get the following link errors:



Code:

$ make
psp-g++ -I. -I/c/devkitPro/devkitPSP/psp/sdk/include -O2 -G0 -Wall -I. -I/c/devkitPro/devkitPSP/psp/sdk/include -O2 -G0 -Wall -fexceptions -fno-rtti   -c -o main.o main.cpp
main.cpp: In function 'int main()':
main.cpp:167: warning: comparison between signed and unsigned integer expressions
main.cpp: At global scope:
main.cpp:77: warning: 'X' defined but not used
main.cpp:77: warning: 'Y' defined but not used
main.cpp:78: warning: 'MX' defined but not used
main.cpp:78: warning: 'MY' defined but not used
main.cpp:79: warning: 'bg_col' defined but not used
main.cpp:79: warning: 'fg_col' defined but not used
main.cpp:81: warning: 'g_vram_offset' defined but not used
main.cpp:83: warning: 'init' defined but not used
psp-gcc -I. -I/c/devkitPro/devkitPSP/psp/sdk/include -O2 -G0 -Wall  -L. -L/c/dev
kitPro/devkitPSP/psp/sdk/lib   main.o  -lpspdebug -lpspdisplay -lpspge -lpspctrl
 -lpspsdk -lc -lpsputility -lpspuser -lpspkernel -o cwd.elf
main.o: In function `main':
main.cpp:(.text+0x4c4): undefined reference to `__cxa_begin_catch'
main.cpp:(.text+0x4d8): undefined reference to `__cxa_end_catch'
main.cpp:(.text+0x4e8): undefined reference to `__cxa_end_catch'
main.o:(.eh_frame+0x12): undefined reference to `__gxx_personality_v0'
c:/devkitpro/devkitpsp/bin/../lib/gcc/psp/4.0.2\libgcc.a(unwind-dw2.o): In function `base_of_encoded_value':
: undefined reference to `abort'
c:/devkitpro/devkitpsp/bin/../lib/gcc/psp/4.0.2\libgcc.a(unwind-dw2.o): In function `base_of_encoded_value':
: undefined reference to `abort'
c:/devkitpro/devkitpsp/bin/../lib/gcc/psp/4.0.2\libgcc.a(unwind-dw2.o): In function `read_encoded_value_with_base':
: undefined reference to `abort'
c:/devkitpro/devkitpsp/bin/../lib/gcc/psp/4.0.2\libgcc.a(unwind-dw2.o): In function `_Unwind_GetGR':
: undefined reference to `abort'
c:/devkitpro/devkitpsp/bin/../lib/gcc/psp/4.0.2\libgcc.a(unwind-dw2.o): In function `_Unwind_SetGR':
: undefined reference to `abort'
c:/devkitpro/devkitpsp/bin/../lib/gcc/psp/4.0.2\libgcc.a(unwind-dw2.o):: more undefined references to `abort' follow
make: *** [cwd.elf] Error 1


Someone knows the cause of the problem?
Back to top
View user's profile Send private message
PeterM



Joined: 31 Dec 2005
Posts: 125
Location: Edinburgh, UK

PostPosted: Sun Jan 01, 2006 12:29 am    Post subject: Reply with quote

I've gotten exceptions working before, but I can't immediately see anything really wrong with your command lines.

Try adding -lstdc++ to the LIBS variable in the makefile?
Back to top
View user's profile Send private message Visit poster's website
korskarn



Joined: 31 Dec 2005
Posts: 15

PostPosted: Sun Jan 01, 2006 1:06 am    Post subject: Reply with quote

Thanks, that was the problem, libstdc++ missing in the makefile! (the sample I used as a starting point was originally in C, not C++)
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 -> PSP 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