| View previous topic :: View next topic |
| Author |
Message |
pacman2323
Joined: 03 Jul 2006 Posts: 13
|
Posted: Tue Jul 04, 2006 9:41 am Post subject: Problem with 'Hello World' |
|
|
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 |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
|
| Back to top |
|
 |
pacman2323
Joined: 03 Jul 2006 Posts: 13
|
Posted: Tue Jul 04, 2006 10:11 am Post subject: |
|
|
| What did he screw up? |
|
| Back to top |
|
 |
pacman2323
Joined: 03 Jul 2006 Posts: 13
|
Posted: Tue Jul 04, 2006 10:43 am Post subject: |
|
|
| 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 |
|
 |
pacman2323
Joined: 03 Jul 2006 Posts: 13
|
Posted: Tue Jul 04, 2006 11:40 am Post subject: |
|
|
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 |
|
 |
ooPo Site Admin
Joined: 17 Jan 2004 Posts: 2032 Location: Canada
|
Posted: Tue Jul 04, 2006 11:48 am Post subject: |
|
|
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 |
|
 |
dot_blank

Joined: 28 Sep 2005 Posts: 498 Location: Brasil
|
Posted: Tue Jul 04, 2006 12:28 pm Post subject: |
|
|
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 |
|
 |
pacman2323
Joined: 03 Jul 2006 Posts: 13
|
Posted: Tue Jul 04, 2006 2:41 pm Post subject: |
|
|
| So how would I rewrite it? |
|
| Back to top |
|
 |
groepaz

Joined: 01 Sep 2005 Posts: 305
|
|
| Back to top |
|
 |
|