but im only 14 years old
and ive been looking at this forum for a bit now and
i final have a problem and i hope someone can help me
but i tried to make my program with cygwin and it worked b4 and then i tryed to make it agian and this happened
Code: Select all
Mine@mine /projects/helloworld2
$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall   -c -o main.o mai
n.c
main.c: In function 'main':
main.c:63: warning: unused variable 't'
main.c:62: warning: unused variable 'g'
main.c:61: warning: unused variable 'i'
main.c:58: warning: unused variable 'pad'
main.c: At top level:
main.c:67: error: syntax error before string constant
main.c:67: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:67: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:67: warning: data definition has no type or storage class
main.c:68: error: syntax error before string constant
main.c:68: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:68: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:68: warning: data definition has no type or storage class
main.c:69: error: syntax error before string constant
main.c:69: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:69: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:69: warning: data definition has no type or storage class
main.c:70: error: syntax error before string constant
main.c:70: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:70: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:70: warning: data definition has no type or storage class
main.c:71: error: syntax error before string constant
main.c:71: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:71: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:71: warning: data definition has no type or storage class
main.c:79: error: syntax error before string constant
main.c:79: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:79: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:79: warning: data definition has no type or storage class
main.c:85: warning: type defaults to 'int' in declaration of 'pspDebugScreenClea
r'
main.c:85: error: conflicting types for 'pspDebugScreenClear'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:96: error: previous declaration of
'pspDebugScreenClear' was here
main.c:85: warning: data definition has no type or storage class
main.c:86: error: syntax error before '+=' token
main.c:93: error: syntax error before string constant
main.c:93: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:93: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:93: warning: data definition has no type or storage class
main.c:94: error: syntax error before string constant
main.c:94: warning: type defaults to 'int' in declaration of 'pspDebugScreenPrin
tf'
main.c:94: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:94: warning: data definition has no type or storage class
main.c:101: warning: type defaults to 'int' in declaration of 'pspDebugScreenCle
ar'
main.c:101: error: conflicting types for 'pspDebugScreenClear'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:96: error: previous declaration of
'pspDebugScreenClear' was here
main.c:101: warning: data definition has no type or storage class
main.c:102: error: syntax error before string constant
main.c:102: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:102: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:102: warning: data definition has no type or storage class
main.c:103: error: syntax error before string constant
main.c:103: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:103: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:103: warning: data definition has no type or storage class
main.c:104: error: syntax error before string constant
main.c:104: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:104: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:104: warning: data definition has no type or storage class
main.c:113: warning: type defaults to 'int' in declaration of 'pspDebugScreenCle
ar'
main.c:113: error: conflicting types for 'pspDebugScreenClear'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:96: error: previous declaration of
'pspDebugScreenClear' was here
main.c:113: warning: data definition has no type or storage class
main.c:114: error: syntax error before string constant
main.c:114: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:114: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:114: warning: data definition has no type or storage class
main.c:115: error: syntax error before string constant
main.c:115: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:115: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:115: warning: data definition has no type or storage class
main.c:116: error: syntax error before string constant
main.c:116: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:116: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:116: warning: data definition has no type or storage class
main.c:138: error: syntax error before string constant
main.c:138: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:138: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:138: warning: data definition has no type or storage class
main.c:139: error: syntax error before '+=' token
main.c:145: error: syntax error before string constant
main.c:145: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:145: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:145: warning: data definition has no type or storage class
main.c:146: error: syntax error before '+=' token
main.c:154: error: syntax error before string constant
main.c:154: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:154: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:154: warning: data definition has no type or storage class
main.c:155: error: syntax error before string constant
main.c:155: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:155: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:155: warning: data definition has no type or storage class
main.c:156: error: syntax error before string constant
main.c:156: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:156: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:156: warning: data definition has no type or storage class
main.c:157: error: syntax error before string constant
main.c:157: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:157: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:157: warning: data definition has no type or storage class
main.c:158: error: syntax error before string constant
main.c:158: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:158: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:158: warning: data definition has no type or storage class
main.c:159: error: syntax error before string constant
main.c:159: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:159: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:159: warning: data definition has no type or storage class
main.c:160: error: syntax error before string constant
main.c:160: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:160: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:160: warning: data definition has no type or storage class
main.c:161: error: syntax error before string constant
main.c:161: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:161: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:161: warning: data definition has no type or storage class
main.c:162: error: syntax error before string constant
main.c:162: warning: type defaults to 'int' in declaration of 'pspDebugScreenPri
ntf'
main.c:162: error: conflicting types for 'pspDebugScreenPrintf'
/usr/local/pspdev/psp/sdk/include/pspdebug.h:40: error: previous declaration of
'pspDebugScreenPrintf' was here
main.c:162: warning: data definition has no type or storage class
make: *** [main.o] Error 1
Code: Select all
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspctrl.h>
#define printf pspDebugScreenPrintf
#define N 100
PSP_MODULE_INFO("The Guessing Game", 0, 1, 1);
/* 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() {
    
    SceCtrlData pad;
    pspDebugScreenInit();
    SetupCallbacks();
    int i = 1;
    int g = 1;
    int t = 1;
}
        printf("     ___     _  _    ___    ___   ___ ___    ___    ___    ____  \n");
        printf("    / _ \\   | \\| |  | __|  | __| |   V   |  |_  |  |_  |  |__  | \n");
        printf("   / /_\\ \\  |    |  |__ |  | __| | |\\_/| |   / /_   / /_    / / \n");
        printf("  /_/   \\_\\ |_|\\_|  |___|  |___| |_|   |_|  |____| |____|  /_/ \n");
    printf("Press [X] To Make a Random Number\n");
while(1)
    {
         sceCtrlReadBufferPositive(&pad, 1);
  if(pad.Buttons & PSP_CTRL_CROSS) {
                    break;
          }
}
    printf("Press [O] To Make a Random Number\n");
while(1) {
          sceCtrlReadBufferPositive(&pad, 1);
          if(pad.Buttons & PSP_CTRL_CIRCLE) {
                    break;
          }
          pspDebugScreenClear();
          i += 1;
          if (i > 500)
            {
                 i = 1;
                 }
    }
    printf("Ok now for the game\n");
    printf("guess a number (1-500)\n");
while(1) {
         sceCtrlReadBufferPositive(&pad, 1);
    if (pad.Buttons & PSP_CTRL_UP)
    {
                    g += 1;
                    pspDebugScreenClear();
                    printf("Ok now for the game\n");
                    printf("guess a number (1-500)\n");
                    printf("%d\n",g);
                        if (g > 500)
                    {
                    g = 1;                    
                      }
                    }
    if (pad.Buttons & PSP_CTRL_DOWN)
    {
                    g -= 1;
                    pspDebugScreenClear();
                    printf("Ok now for the game\n");
                    printf("guess a number (1-500)\n");
                    printf("%d\n",g);
                        if (g < 1)
                    {
                    g = 500;                    
                          }
                    }
    if (pad.Buttons & PSP_CTRL_CROSS)
    {
                    if (g == i)
                    {
                          pspDebugScreenClear();
                    {
                    break;
          }
                          
                          }
                    
                    if (g > i)
                    {
                          pspDebugScreenClear();
                          printf("Two High try agian");
                          t += 1;
                          }
                    
                    if (g < i)
                    {
                          pspDebugScreenClear();
                          printf("Two Low try agian");
                          t += 1;
                          }
                    
                    }
    
}
while (1) {
      printf("W     \n");
      printf(" I    \n");
      printf("  N   \n");
      printf("   N  \n");
      printf("    E \n");
      printf("     R\n");
      printf("      \n");
      printf("      \n");
      printf("WINNER\n");
      printf("In %d Tries\n",t);
      }
}
and im sorry