Page 1 of 1

PS2SDK with C++ problem

Posted: Thu Jul 15, 2004 9:23 pm
by zerocom
Hi,

I'm trying to get a C++ project to work with PS2SDK, but i have some linking problems. I have to use ee-g++ for linking, but this results in an error with the libc.a, which cannot link fioWrite().

To fix this I already tried to link the whole ps2sdk with g++, but this doesn't fix this problem. Compiling the ps2sdk with g++ doesn't work because of some missing functionality of the g++.

Any solutions?

Bye...

Posted: Wed Jul 21, 2004 9:39 am
by rasmus
I pulled my hair slightly before I found a solution to this. The problem is the link order of the libraries. When you link with ee-g++ it adds libstdc++ to the link automatically, but unfortunately in the wrong order. Link with ee-gcc instead and add libstdc++ manually before any other libraries in ps2sdk. Also make sure you use the link order described before with libc include twice.

Like this:

Code: Select all

$ ee-gcc -nostartfiles -Tlinkfile crt0.o main.o -lstdc++ -lc -lkernel -lsyscall -lc

Posted: Thu Jul 22, 2004 8:28 pm
by zerocom
Thanks for the info ...

I tried linking using the gcc instead of the g++ but it gaves a linking error with some c++ stuff. But this may be caused by the missing libstdc++.

I'll try your solution and report again ...

Bye...