[Playstation 3-Ubuntu] printf problem

General questions regarding the usage of CodeLite
Disane
CodeLite Curious
Posts: 3
Joined: Tue Jun 29, 2010 11:03 pm
Genuine User: Yes
IDE Question: C++
Contact:

[Playstation 3-Ubuntu] printf problem

Post by Disane »

Hi people!

I'm sure you haven't heard of me but I wrote a tutorial on how to use Codelite on the Playstation 3. I did a little bit of research on which IDE runs the fastest on the PS3 Linux (only 192 MB RAM available) and I came to the conclusion CodeLite runs quite nicely and its easy to configure. While Eclipse,Code::Blocks and the other IDEs are painfully slow and hard to configure to work with the Cell SDK.
Here's the link for the tutorial:
http://www.haxnetwork.net/showthread.php?t=12091

A lot of people read my tutorial. The only problem is that no one could solve the (what I call) SPU-printf code compilation in CodeLite :(

Code: Select all

#include <stdio.h>

int main(unsigned long long spe, unsigned long long argp, unsigned long long envp)
{
       printf("SPU number: %d says Hello!\n",spe);
       return 0;
}

Code: Select all

main.cpp:5: undefined reference to `__nldbl_printf'
This is really an open question I could not answer. It seems to compile fine with spu-gcc in the terminal but when I do the same in Codlite it pukes the error (I mentioned above) at me. The interesting part is that if i use

Code: Select all

printf("Hello World!");
and compile it. It works quite nicely...
You can view the settings I used in the tutorial.
Anyone any idea?

Thanks in advance. :mrgreen:
DavidGH
CodeLite Plugin
Posts: 819
Joined: Wed Sep 03, 2008 7:26 pm
Contact:

Re: [Playstation 3-Ubuntu] printf problem

Post by DavidGH »

Hi,
I'm sure you haven't heard of me
That's OK, you haven't heard of me either ;)

Code: Select all

int main(unsigned long long spe, unsigned long long argp, unsigned long long envp)
{
       printf("SPU number: %d says Hello!\n",spe);
       return 0;
}
You're trying to print an unsigned long long, using '%d'. That's a bit optimistic; you'll get more accurate results using '%llu'. However that's unlikely to be the cause of your problem, as the error doesn't occur from a terminal.

I've no PS3 knowledge, but I put your error message into google. The top result looks interesting: it may be that there are two toolchains on your system, and the CodeLite-generated makefile is using the wrong one.

Regards,

David
Post Reply