C++ class make the psp turn off
C++ class make the psp turn off
If found that when I use class in my project, even my file can compile , when it run at the psp , psp will stop response and then turn.
for example , I cant call this : testclass * tc = new testclass();
what's going on ? Is my toolchain out of date or other issues make this error?
Thanks all of your help~
for example , I cant call this : testclass * tc = new testclass();
what's going on ? Is my toolchain out of date or other issues make this error?
Thanks all of your help~
actually my code is really normal as a c++ project;
I only define a test class , and try to init it by using "new" operator
and compiler option should not affect the result since "new" operator is just allocate memory for the class. that's mean I cant use "memalloc" too.
may be the problem is due to out date of my toolchain, I will try to update it.
I only define a test class , and try to init it by using "new" operator
and compiler option should not affect the result since "new" operator is just allocate memory for the class. that's mean I cant use "memalloc" too.
may be the problem is due to out date of my toolchain, I will try to update it.
raf wrote:I also use C++ in PSPRadio and it works fine.. Are you compiling against libc or newlib? Try updating the toolchain/sdk...FIF wrote:hi,
I'm a newbee in psp dev, but my c++ code run fine on my psp. Can you give me more informations about your code/makefile ?
Raf.
but my class is just like this
really simple but create error , even I have updated my toolchain.
Code: Select all
class testclass{
public:
char *testc;
};
Shine wrote:No, the new operator calls the constructor, too, which could crash and all constructors of objects you've declared as member variables, like "std::string m_name".laichung wrote:and compiler option should not affect the result since "new" operator is just allocate memory for the class.
I think the problem of mine sdk is , malloc is not work , and I dont know why:
Even this simple code will turn off my psp. Any one know what's going on? Big thanks.
Code: Select all
int *ptr = (int *)malloc(sizeof(int) * 10);
I have solve the problem by changing the order of the library in the make file. thanks.
The problem is cause by , when it call malloc function , psp will turn off.
I dont know what the order of the library will make this error. (May be the program reference to a wrong function.)
The problem is cause by , when it call malloc function , psp will turn off.
I dont know what the order of the library will make this error. (May be the program reference to a wrong function.)
seventoes wrote:Are you sure its the class that is turning it off? You could have another error.