devkitPSP and codeblocks linking errors

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
michaelp
Posts: 7
Joined: Mon Jul 02, 2007 2:21 am

devkitPSP and codeblocks linking errors

Post by michaelp »

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: Select all

// Hello World - A simple "Hello World" Application.

#include <pspkernel.h>
#include <pspdebug.h>

PSP_MODULE_INFO&#40;"Hello World", 0, 1, 1&#41;;

// Exit callback
int ExitCallback&#40;int Arg1, int Arg2, void *Common&#41;
&#123;
    sceKernelExitGame&#40;&#41;;
    return 0;
&#125;

// Callback thread
int CallbackThread&#40;SceSize Args, void *Argp&#41;
&#123;
    int CallbackId;

    CallbackId = sceKernelCreateCallback&#40;"Exit Callback", ExitCallback, NULL&#41;;
    sceKernelRegisterExitCallback&#40;CallbackId&#41;;

    sceKernelSleepThreadCB&#40;&#41;;

    return 0;
&#125;

// Sets up the callback thread and returns its thread id
int SetupCallbacks&#40;void&#41;
&#123;
    int ThreadId = 0;

    ThreadId = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, 0, 0&#41;;
    if &#40;ThreadId >= 0&#41;
    &#123;
        sceKernelStartThread&#40;ThreadId, 0, 0&#41;;
    &#125;

    return ThreadId;
&#125;

int main&#40;int argc, char ** argv&#41;
&#123;
    pspDebugScreenInit&#40;&#41;;
    SetupCallbacks&#40;&#41;;

     while&#40;1&#41;
    &#123;
        pspDebugScreenPrintf &#40;"Hello World"&#41;;
        sceDisplayWaitVblankStart&#40;&#41;;
    &#125;

    sceKernelSleepThread&#40;&#41;;

    return 0;
&#125;
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/i ... pic=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- ... 81882.html
Post Reply