| View previous topic :: View next topic |
| Author |
Message |
korskarn
Joined: 31 Dec 2005 Posts: 15
|
Posted: Sun Jan 01, 2006 12:20 am Post subject: Link error when using C++ exceptions (try-catch) |
|
|
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 |
|
 |
PeterM
Joined: 31 Dec 2005 Posts: 125 Location: Edinburgh, UK
|
Posted: Sun Jan 01, 2006 12:29 am Post subject: |
|
|
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 |
|
 |
korskarn
Joined: 31 Dec 2005 Posts: 15
|
Posted: Sun Jan 01, 2006 1:06 am Post subject: |
|
|
| 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 |
|
 |
|