I need help about c++ dev with PS2DEV Environment.

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
User avatar
JaCkRaC
Posts: 5
Joined: Wed Oct 06, 2004 10:43 pm

I need help about c++ dev with PS2DEV Environment.

Post by JaCkRaC »

I have already made some little demos with C. But I want, now, to make my progs in C++.
So I took the last PS2Dev Environment. But when I try to 'make' (compilation) the hello_c++ sample, I got an error on linking:
in function: 'main'
Undefined reference to _gxx_personality__v0

Why I got this error? How solve this problem? Do I got a patch for the binutils ?
Please, try to give me a lot of details, and don't use too much complicated sentences because I speak French!
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

How do you link exactly ?

You need to have libstdc++ linked with your final software, or linking using ee-g++ (which is about the same)

Et parler français semble devenir une tare ce jours-ci :D
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.
User avatar
JaCkRaC
Posts: 5
Joined: Wed Oct 06, 2004 10:43 pm

Post by JaCkRaC »

Oups, Déjà une réponse ! :)

J'espère, PIXEL, que vous utilisez souvent PS2Dev environnement!
Voila l'exemple que je compile:

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>
#include <sifrpc.h>
#include "sio.h"

extern "C" { extern void _init( void ); }

int main()
{
_init();

SifInitRpc(0);

init_scr();
scr_printf("Hello, world!\n");

printf("Hello, world!\n");
nprintf("Hello, again, from Naplink RPC!\n");

sio_init(115200, 0, 0, 0, 0);
sio_printf("Hello from EE SIO!\n");

return 0;
}


Et voici le makefile utilisé:

EE_BIN = hello.elf
EE_OBJS = hello.o

all: $(EE_BIN)

clean:
rm -f *.elf *.o *.a

include ../../../Makefile.pref
include ../../../Makefile.eeglobal_cpp


La phase de compilation se passe correctement et le fichier hello.o est généré.
Mais il y a l'erreur lors du linkage.

Si vous le souhaitez, j'afficherai 'Makefile.eeglobal_cpp' dans mon prochain poste.

J'ai bien l'impression qu'il est temps pour moi d'apprendre a installer manuellement l'environnement de developpement PS2! =)
User avatar
JaCkRaC
Posts: 5
Joined: Wed Oct 06, 2004 10:43 pm

Post by JaCkRaC »

Il n'y a personne pour m'aider ???
pixel
Posts: 791
Joined: Fri Jan 30, 2004 11:43 pm

Post by pixel »

You shouldn't write in french only... although there may be some french that could give you some parts written in french if you don't understand everything, this is nicer for everybody to make efforts and write in english.

Now, you didn't include enough details (although the source code isn't C++, rather C, I guess this is only a test run.)

Rajoute le log produit lorsque tu tapes 'make'.
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.
User avatar
JaCkRaC
Posts: 5
Joined: Wed Oct 06, 2004 10:43 pm

Post by JaCkRaC »

Thank you; pixel.
I will try to speak in English.

Can somebody give me a little c++ code example which I can build with PS2SDK?
I saw somewhere that I need to do some hacks in c++ code or some patchs on binutils, to build a c++ code file. Is that true?
Post Reply