I'm in the middle of porting some C++ heavy code, and I think that it's pretty close to finished, as all the cpp files can be compiled into .o files, but when I come to link them all I get this error:
/psp/lib/libstdc++.a(vterminate.o):../../../../libstdc++-v3/libsupc++/vterminate.cc:69:relocation truncated to fit: R_MIPS_GPREL16 against '_impure_ptr'
Now although I've programmed in C++ before, I havent used g++ before, so I don't really know where to go from here.
Any help appreciated.
add -G0 to CXXFLAGS (or CPPFLAGS) hmm or perhaps to link flags since is a problem when linking stdc++ it's seams that libstdc++ is not compiled with -G0
Yes, the recent changes to psplibc make linking to libstdc++ impossible. libstdc++ is built against the newlib headers, which define _impure_ptr. So you have to link against newlib if you want to link against libstdc++.
As far as -G0 goes, it's no longer required for your own source. If you try using -G8 (or just leave -G0 out) and get any linker errors you should bring them up.
In short, do not use psplibc when building a C++ program.
I've managed to link some c++ stuff, buy using gcc instead of g++ and adding -lstdc++, anyway there are some issues with the linker, since linked library are not position indipendant in the command line and sometimes getting the correct sequence is a nightmare
Well, for those interested, I've got away from the linker problems by removing PSPSDK_LIBC, and now i'm back to project-related errors, which are very numerous, but hopefully solveable.
If I come up with any more linker problems, i'll post them here.