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 

undefined error please help me

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



Joined: 25 Dec 2005
Posts: 10

PostPosted: Wed Dec 28, 2005 2:27 am    Post subject: undefined error please help me Reply with quote

Hi !!!!!

http://img447.imageshack.us/my.php?image=untitled11ba.jpg

Why I have these error.


Last edited by dbgtnet on Fri Jan 06, 2006 9:08 am; edited 2 times in total
Back to top
View user's profile Send private message
danzel



Joined: 04 Nov 2005
Posts: 182

PostPosted: Wed Dec 28, 2005 7:31 am    Post subject: Reply with quote

Add -lpspgu to your libs.

You should have a line in the makefile like:
Code:
LIBS = -lpspgu


That will get rid of the 'undefined reference to sceGu...' messages.

The warning messages at the top (pointer from integer) are because you are using the wrong datatypes, I haven't used the Gu functions much so I can't help you more there.
Back to top
View user's profile Send private message
dbgtnet



Joined: 25 Dec 2005
Posts: 10

PostPosted: Thu Dec 29, 2005 2:05 am    Post subject: Reply with quote

Thanks that repair that error !!!!
Back to top
View user's profile Send private message
sandberg



Joined: 05 Oct 2005
Posts: 90
Location: Denmark

PostPosted: Thu Dec 29, 2005 9:30 am    Post subject: Reply with quote

sceGuTexImage(0,512,512,512,logo_temp);

sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D,6,0,vertices);

Both the arguments in red above are pointers. for sceGuTexImage is it a pointer to your texture and for the sceGuDrawArray it is a pointer to your vertices. In your code you have these defined as the datatype int.
So you should either declare your variables as pointers or make a typecast in your code.

sceGuTexImage(0,512,512,512,(const void *)logo_temp);

sceGuDrawArray(GU_TRIANGLES,GU_TEXTURE_32BITF|GU_COLOR_8888|GU_VERTEX_32BITF|GU_TRANSFORM_3D,6,0,(const void *)vertices);
_________________
Br, Sandberg
Back to top
View user's profile Send private message
dbgtnet



Joined: 25 Dec 2005
Posts: 10

PostPosted: Fri Jan 06, 2006 9:07 am    Post subject: Reply with quote

I have this error now

make: *** No rule to make target 'graphics.o', needed by 'test.elf', stop.
Back to top
View user's profile Send private message
sandberg



Joined: 05 Oct 2005
Posts: 90
Location: Denmark

PostPosted: Fri Jan 06, 2006 9:23 am    Post subject: Reply with quote

dbgtnet wrote:
I have this error now

make: *** No rule to make target 'graphics.o', needed by 'test.elf', stop.


Would probably be easier to answer if you showed ud your makefile :)
_________________
Br, Sandberg
Back to top
View user's profile Send private message
dbgtnet



Joined: 25 Dec 2005
Posts: 10

PostPosted: Fri Jan 06, 2006 9:29 am    Post subject: Reply with quote

I found the error.
But now the flipscreen and initgraphics are undefined reference which library i need to include.

Code:
TARGET = test
OBJS = main.o graphics.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpspgum -lpspgu -lpng -lz -lm
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Pong par moi

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak


Code:
// Pong PSP par Maxime Dupré Corriveau
// Débuter le 10 Décembre 2005
// Finis le -----------------
         //Inclure les librairies PSP
#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <png.h>
#include <stdio.h>
#include "graphics.c"

#define printf pspDebugScreenPrintf // Remplacer les codes pc par ceux
#define clrscr pspDebugScreenClear
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))

/* Define the module info section */
PSP_MODULE_INFO("Pong Par Moi :D", 0, 1, 1);

/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int a215 = 0;
int done = 0;
int x1 = 0;
int x2 = 0;
int Image = 0;
int ourImage = 0;

void dump_threadstatus(void);
 
/* Exit callback */
int exit_callback(int arg1, int arg2, void *common)
{
   done = 1;
   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(void)
{
   char buffer[200];
   Image* ourImage;
   initGraphics();
   clrscr();
   SceCtrlData pad;
   pspDebugScreenInit();
   SetupCallbacks();
   pspDebugScreenSetXY(0, 2);
   printf("Je vous pr\x82sente mon jeu de pong.\n Il a \x82t\x82 programmer pour l'expo science.");
   printf("\n  Pour commencer a jouer veuillez appuyer sur le bouton X.");
             while(1){
            sceCtrlReadBufferPositive(&pad, 1);
           if(pad.Buttons & PSP_CTRL_CROSS){
                    break;
                         }
       }
   clrscr();
   pspDebugScreenSetXY(0, 2); 
   printf("Les boutons du joueur 1 sont : Fleche Haut et Fleche bas.\n Pour le joueur 2 : Triangle et X.");
   printf("\n  Pour partir le jeu appuyer sur START.");
          while(1){
         sceCtrlReadBufferPositive(&pad, 1);
           if(pad.Buttons & PSP_CTRL_START){
                    break;
          }
       }
            clrscr();
        sprintf(buffer, "background.png");
          ourImage = loadImage(buffer);
        if (!ourImage) {
                    //Image load failed
          printf("Image load failed!\n");
          } else {
        int x = 0;
          int y = 0;
        while (x < 480) {
          while (y < 272) {
        blitAlphaImageToScreen(0 ,0 ,32 , 32, ourImage, x, y);
          y += 32;
          }
        x += 32;
          y = 0;
          }
        flipScreen();
          }
          sceDisplayWaitVblankStart();
   while(!done){
          sceCtrlReadBufferPositive(&pad, 1);
         if (pad.Buttons != 0){
         if (pad.Buttons & PSP_CTRL_TRIANGLE){
            printf("Triangle pressed \n");
            x2++;
         }
         if (pad.Buttons & PSP_CTRL_CROSS){
            printf("Cross pressed \n");
            x2--;
         }
         if (pad.Buttons & PSP_CTRL_UP){
            printf("Up pressed \n");
            x1++;
         }
         if (pad.Buttons & PSP_CTRL_DOWN){
            printf("Down pressed \n");
            x1--;
         }   
         clrscr();
          printf("Le pad 1 : %d",x1);
          printf("\n Le pad 2 : %d",x2);
      }
     }
   sceKernelSleepThread();   
   return 0;
}
Back to top
View user's profile Send private message
sandberg



Joined: 05 Oct 2005
Posts: 90
Location: Denmark

PostPosted: Fri Jan 06, 2006 9:47 am    Post subject: Reply with quote

I've never heard of them before, so can't help you out there. Also, doing a grep in the spsdev repository doesn't return any mathces for those functions anywhere.

Why do you use those functions ? You must have seen them used somewhere or read about them somewhere ?
_________________
Br, Sandberg
Back to top
View user's profile Send private message
weltall



Joined: 20 Feb 2004
Posts: 310

PostPosted: Fri Jan 06, 2006 6:23 pm    Post subject: Reply with quote

why you are including a c file :S
just include a header with the list of graphic.c function, then another thing do you have a graphic.c file inside your folder?
Back to top
View user's profile Send private message Visit poster's website
dbgtnet



Joined: 25 Dec 2005
Posts: 10

PostPosted: Sat Jan 07, 2006 3:13 am    Post subject: Reply with quote

This is the error
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