Hi,
I have check some examples and KernelPollCallbacks appears, but it seems not to exist in pspsdk ( I did a full search on the pspsdk files), any idea?.
HexDump.
KernelPollCallbacks?
thanks a lot MrBrown. A little more thing, I have copied and pasted the callback code from the example and I get this error
main.cpp invalid conversion from 'void (*)(void*)' to 'void*' .
It worked when I compled the example but not in my code. It is strange you should allways pass a Funcion name as a void*, any help please?.
NOTE: I´m compiling c++ code, and the example c code, perhaps this is the problem.
HexDump.
main.cpp invalid conversion from 'void (*)(void*)' to 'void*' .
It worked when I compled the example but not in my code. It is strange you should allways pass a Funcion name as a void*, any help please?.
NOTE: I´m compiling c++ code, and the example c code, perhaps this is the problem.
HexDump.
I am getting a similar error using psptoolchain-20050705.tgz and PSPSDK-svn rev 579(2005-7-10). I renamed main.c to main.cpp in the cube, wavegen, and fileio samples and I get the following errors:
Does C++ use a different convention for function pointers?
Code: Select all
main.cpp: In function 'void CallbackThread(void*)':
main.cpp:39: error: invalid conversion from 'int (*)()' to 'void*'
main.cpp:39: error: initializing argument 2 of 'int sceKernelCreateCallback(const char*, void*, void*)'
main.cpp: In function 'int SetupCallbacks()':
main.cpp:50: error: invalid conversion from 'void (*)(void*)' to 'int (*)(SceSize, void*)'
main.cpp:50: error: initializing argument 2 of 'SceUID sceKernelCreateThread(const char*, int (*)(SceSize, void*), int, int, SceUInt, SceKernelThreadOptParam*)'
make: *** [main.o] Error 1
C++ has stricter type checking that C does, in C passing any pointer to void * will be autoconverted, in C++ it will complain. Either you do something like sceKernelCreateCallback("MyCallback", static_cast<void *>(CallbackThread), ...) or actually make sure your thread function has the correct prototype.