michaelp
Joined: 02 Jul 2007 Posts: 7
|
Posted: Wed Apr 30, 2008 7:54 am Post subject: devkitPSP and codeblocks linking errors |
|
|
Okay, so I have set up Code::Blocks IDE with the devkitPSP compiler using a tutorial of yaustar's. Anyways, I want to compile C++ code using this set up, and the function sceDisplayWaitVblankStart() is not working, it causes errors in my code. So, this is what I did first:
| Code: | // Hello World - A simple "Hello World" Application.
#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO("Hello World", 0, 1, 1);
// Exit callback
int ExitCallback(int Arg1, int Arg2, void *Common)
{
sceKernelExitGame();
return 0;
}
// Callback thread
int CallbackThread(SceSize Args, void *Argp)
{
int CallbackId;
CallbackId = sceKernelCreateCallback("Exit Callback", ExitCallback, NULL);
sceKernelRegisterExitCallback(CallbackId);
sceKernelSleepThreadCB();
return 0;
}
// Sets up the callback thread and returns its thread id
int SetupCallbacks(void)
{
int ThreadId = 0;
ThreadId = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if (ThreadId >= 0)
{
sceKernelStartThread(ThreadId, 0, 0);
}
return ThreadId;
}
int main(int argc, char ** argv)
{
pspDebugScreenInit();
SetupCallbacks();
while(1)
{
pspDebugScreenPrintf ("Hello World");
sceDisplayWaitVblankStart();
}
sceKernelSleepThread();
return 0;
} |
Tried to compile that as C++ code, and I got an error about sceDisplayWaitVblankStart() not being defined in this scope. So, after some searching, I read I need to add -lpspdisplay and #include <pspdisplay.h> to my compilation process. And then, this happens:
http://www.psp-programming.com/forums/index.php?topic=2994.0
I do have -lstdc++ in my libs line for Code::Blocks. I have no clue what else I have to do. Help?
P.S. This is the tutorial I used for setting up devkitPSP with C::B.
http://forums.qj.net/f-psp-development-forum-11/t-tutorial-setting-up-codeblocks-with-devkitpsp-81882.html |
|