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 

Problem with 'Hello World'

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



Joined: 03 Jul 2006
Posts: 13

PostPosted: Tue Jul 04, 2006 9:41 am    Post subject: Problem with 'Hello World' Reply with quote

Ok, I'm following this tutorial: http://www.psp-programming.com/tutorials/c/lesson02.htm

And I've gotten all the way to here-
"Now open up a CYGWIN Bash Shell and "cd" into your "projects/helloworld" directory. Type "make" and your shell should output some stuff to you. It will tell you if your source code had any errors that made it uncompilable. Generally, if it gives you a few warnings, it's not a big deal. Errors are what you want to watch out for, warnings are just possible points that could cause bugs. Note: if you have Firmware Version 1.50, you can automatically generate your two folders by typing "make kxploit" instead of "make.""

But when I do that I get this-
make: *** No rule to make target 'main.o', needed by 'hello.elf'. Stop.

What went wrong?
Back to top
View user's profile Send private message
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Tue Jul 04, 2006 10:11 am    Post subject: Reply with quote

ask the one who wrote that tutorial and/or the makefile for that helloworld. he screwed it up :=)
_________________
http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/
Back to top
View user's profile Send private message Visit poster's website
pacman2323



Joined: 03 Jul 2006
Posts: 13

PostPosted: Tue Jul 04, 2006 10:11 am    Post subject: Reply with quote

What did he screw up?
Back to top
View user's profile Send private message
pacman2323



Joined: 03 Jul 2006
Posts: 13

PostPosted: Tue Jul 04, 2006 10:43 am    Post subject: Reply with quote

Oops, I mispelled the filename. My bad. I noticed it made 'hello' and 'hello%' to put on the PSP, but it also made 'hello.elf', 'main.o' and 'PARAM.SFO'. What do I do with those?
Back to top
View user's profile Send private message
pacman2323



Joined: 03 Jul 2006
Posts: 13

PostPosted: Tue Jul 04, 2006 11:40 am    Post subject: Reply with quote

Got a problem with Lesson 3 though:

here's my code-
Code:
// Counter Program - My Second App for the PSP

/*
          This program was created by Pac Man on July 3, 2006.
          It is a simple Counter Program.
*/

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

PSP_MODULE_INFO("Counter Program", 0, 1, 1);

#define printf pspDebugScreenPrintf

/* Exit callback */
int exit_callback(int arg1, int arg2, void *common) {
          sceKernelExitGame();
          return 0;
}

/* Callback thread */
int CallbackThread(SceSize args, void *argp) {
          int cbid;

          cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
          sceKernelRegisterExitCallback(cbid);

          sceKernelSleepThreadCB();

          return 0;
}

/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void) {
          int thid = 0;

          thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
          if(thid >= 0) {
                    sceKernelStartThread(thid, 0, 0);
          }

          return thid;
}

int main() {
    pspDebugScreenInit();
    SetupCallbacks();
    int counter = 0;
    int i = 0;
    SceCtrlData pad;
    printf("Press [X] To Start the Timer");
    sceKernelSleepThread();
    return 0;
    }
while(1) {
         sceCtrlReadBufferPositive(&pad, 1);
         if(pad.Buttons & PSP_CTRL_CROSS) {
                        break;
         }
}
while(1) {
          sceCtrlReadBufferPositive(&pad, 1);
          if(pad.Buttons & PSP_CTRL_CIRCLE) {
                    break;
          }
    pspDebugScreenClear();
    printf("Press [O] To Stop the Timer\n");
    printf("Counter: %i", counter);
    counter++;
    for(i=0; i<5; i++) {
             sceDisplayWaitVblankStart();
    }
}
pspDebugScreenClear();
printf("Counter Finished.");
printf("Final Count: %i", counter);


And here's the error I'm getting-

Back to top
View user's profile Send private message
ooPo
Site Admin


Joined: 17 Jan 2004
Posts: 2032
Location: Canada

PostPosted: Tue Jul 04, 2006 11:48 am    Post subject: Reply with quote

The link at the top of the page where that tutorial was found leads to their own forums:

http://www.psp-programming.com/dev-forum/

Perhaps you'll find better support there?
Back to top
View user's profile Send private message Visit poster's website
dot_blank



Joined: 28 Sep 2005
Posts: 498
Location: Brasil

PostPosted: Tue Jul 04, 2006 12:28 pm    Post subject: Reply with quote

all after this is outside main function so code is
incorrect
Code:
return 0;
    }
while(1) {
         sceCtrlReadBufferPositive(&pad, 1);

_________________
10011011 00101010 11010111 10001001 10111010
Back to top
View user's profile Send private message
pacman2323



Joined: 03 Jul 2006
Posts: 13

PostPosted: Tue Jul 04, 2006 2:41 pm    Post subject: Reply with quote

So how would I rewrite it?
Back to top
View user's profile Send private message
groepaz



Joined: 01 Sep 2005
Posts: 305

PostPosted: Tue Jul 04, 2006 3:19 pm    Post subject: Reply with quote

what oopo said, those ppl should know a lot better, since they made that stuff :)
_________________
http://www.hitmen-console.org
http://hitmen.c02.at/files/yapspd/
Back to top
View user's profile Send private message Visit poster's website
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