Code: Select all
$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=
150 -L. -L/usr/local/pspdev/psp/sdk/lib main.o -lpspdebug -lpspdisplay -lpsp
ge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolve
r -lpsputility -lpspuser -lpspkernel -o temp.elf
main.o: In function `main':
main.c:(.text+0x88): undefined reference to `initGraphics'
main.o:(.rodata.sceModuleInfo+0x24): undefined reference to `__lib_ent_top'
main.o:(.rodata.sceModuleInfo+0x28): undefined reference to `__lib_ent_bottom'
main.o:(.rodata.sceModuleInfo+0x2c): undefined reference to `__lib_stub_top'
main.o:(.rodata.sceModuleInfo+0x30): undefined reference to `__lib_stub_bottom'
collect2: ld returned 1 exit status
make: *** [temp.elf] Error 1
Code: Select all
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspkernel.h>
#include <time.h>
PSP_MODULE_INFO("temp", 0, 1, 1);
#define printf pspDebugScreenPrintf
/*int displayimg(int xcor, int ycor)
int pollinput(int* xtemp, int* ytemp)*/
/* 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(void)
{
SetupCallbacks();
pspDebugScreenInit();
initGraphics();
int x, temp1, temp2;
int *z;
int *y;
temp1 = 1;
temp1 = 2;
y = &temp1;
z = &temp2;
while(1)
{
pspDebugScreenClear();
tempFunc(temp1, temp2);
printf("temp1 value is %i ", *y);
sleep(1);
for(x=0; x<5; x++)
{
sceDisplayWaitVblankStart();
}
}
sceKernelSleepThread();
return 0;
}
void tempFunc(int *a, int* b)
{
*a = *a + *b
}
Code: Select all
TARGET = temp
OBJS = main.o
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = TEMP
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Might be a problem with the make file??