Programming A PSP Application And Keep Getting A Linker Error (Undefined Reference)
I do not know why I keep getting this linker error because I linked the right library I am sure of it unless I am linking the wrong one but maybe someone knows which is the right library for the 开发者_如何学JAVAfunction SonyOskGu. The error is: main.c:(.text+0x134): undefined reference to `SonyOskGu(char*, unsigned int, char*, char*, int)'. The code is below:
#include <psposk.h>
#include "atoi.h"
PSP_MODULE_INFO("OSLib Sample", 0, 1, 1);
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
#define printf oslPrintf
#define ERROR_SUCCESS 0
#define ERROR -1;
int main(void)
{
oslInit(0);
oslInitGfx(OSL_PF_8888, 0);
oslInitConsole();
oslInitAudio();
printf("Press Any Key To Start OSK In Order To Enter Path Of Audio File To Play Audio:");
char* path = (char*)malloc(255);
SonyOskGu(path,0xff918f8c,0,0,100);
printf("The path is");
OSL_SOUND* sound = oslLoadSoundFile(path, OSL_FMT_NONE);
if (sound == NULL){
oslAssert(sound == NULL);
oslEndGfx();
oslQuit();
return ERROR;
}
else
{
printf("Press X To Play Or Press O To Stop!");
int key = oslWaitKey();
if (key == OSL_KEY_CROSS)
{
oslPlaySound(sound, 0);
}
else if (key == OSL_KEY_CIRCLE)
{
oslStopSound(sound);
}
}
oslEndGfx();
oslQuit();
return ERROR_SUCCESS;
}
The makefile is below:
TARGET = test
OBJS = main.o
INCDIR =
CFLAGS = -G4 -Wall -O2
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
STDLIBS= -losl -lpng -lz \
-lpspsdk -lpspctrl -lpspumd -lpsprtc -lpsppower -lpspgu -lpspaudiolib -lpspaudio -lm -lpsposk -lpspgum -lpspgu -lpng -lz
LIBS=$(STDLIBS)$(YOURLIBS)
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = PSP Audio Player
PSP_EBOOT_ICON = ICON0.png
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
精彩评论