PLZ Help a noob

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

Moderators: cheriff, TyRaNiD

Post Reply
XTC42
Posts: 4
Joined: Sat Aug 04, 2007 10:40 am

PLZ Help a noob

Post by XTC42 »

I am using CYGWIN and the newest PSPDEV Please help as im trying to make a simple hello world app. THANKS

I keep getting this error in cygwin when i type "make"


(might not be 100% correct because i had to type it out since cygwin doesnt let you copy and paste)

Code: Select all

$ make
psp-gcc -I. -I/user/local/pspdev/psp/sdk/include -02 -G0 -Wall -D_PSP_FW_VERSION=
150 -L. -L/usr/local/pspdev/psp/sdk/lib    main.c   -1pspnet_apct1 -1pspnet_resolve
r -1psputility -1pspuser -1pspkernel -o hello.elf
psp-gcc: unrecognized option '-02
main.c:13: error: expected ',' or ';' before 'int'
main.c: In function 'CallbackThread':
main.c&#58;22&#58; error&#58; 'exit_callback' undeclared <first use in this function>
main.c&#58;22&#58; error&#58; <Each undeclared identifier is reported only once
main.c&#58;22&#58; error&#58; for each function it appears in.>
main.c&#58; In function 'main'&#58;
main.c&#58;46&#58; error&#58; expected ';' before 'sceKernelSleepThread'
Make&#58; *** &#91;hello.elf&#93; Error 1


MAKEFILE:

(make file is 100% what i typed)

Code: Select all

TARGET = hello
OBJS = main.c

CFLAGS = -02 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exeptions -fno-rtti

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Joey's Hellow World

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak



last but not least the C:

(C is 100% what i typed)

Code: Select all

// Hello World - My first APP for the psp

/*
            This program was created by Joey Stout on Friday augest 3 2007
            It is a simple "hello world" App
*/

#include <pspkernel.h>
#include <pspdebug.h>
PSP_MODULE_INFO&#40;"Hellow World", 0, 1, 1&#41;
#define printf pspDebugScreenPrintf
/* Exit callback */
int exit_callback&#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 cbid;

          cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
          sceKernelRegisterExitCallback&#40;cbid&#41;;

          sceKernelSleepThreadCB&#40;&#41;;

          return 0;
&#125;

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

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

          return thid;
&#125;
int main&#40;&#41; &#123;
    
pspDebugScreenInit&#40;&#41;;
SetupCallbacks&#40;&#41;;
printf&#40;"Hellow World its Joey A.K.A. XTC"&#41;
sceKernelSleepThread&#40;&#41;;
return 0;
&#125;

Thank you so much.
crazyc
Posts: 408
Joined: Fri Jun 17, 2005 10:13 am

Post by crazyc »

-02
Letter O.
PSP_MODULE_INFO("Hellow World", 0, 1, 1)
and
printf("Hellow World its Joey A.K.A. XTC")
Semicolons after these.
XTC42
Posts: 4
Joined: Sat Aug 04, 2007 10:40 am

Post by XTC42 »

Thanks for helping Crazyc i did what u told me but now when I type "make"

I get this

Image

Edited
User avatar
Wally
Posts: 663
Joined: Mon Sep 26, 2005 11:25 am

Post by Wally »

I got a feeling you are using ' rather than `

press the key with the ~ symbol instead of the talking mark where the talking mark is in your code
XTC42
Posts: 4
Joined: Sat Aug 04, 2007 10:40 am

Post by XTC42 »

I dont think i even used those lol
XTC42
Posts: 4
Joined: Sat Aug 04, 2007 10:40 am

Post by XTC42 »

Oh wait i see...

thanks i got a eboot let me try it


EDIT: SWEET IT WORKED!!!! THANKS SOO MUCH

SRY about the double post BTW

but im soo excited I just took my first step into learning C for the psp. THANK YOU SOOOO MUCH...

finished product (kinda lame but im proud)

http://snookemx.googlepages.com/Myfirstc.zip
Post Reply