forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

devkitPSP and codeblocks linking errors

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
michaelp



Joined: 02 Jul 2007
Posts: 7

PostPosted: Wed Apr 30, 2008 7:54 am    Post subject: devkitPSP and codeblocks linking errors Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group