MiKeL SnAkE escribió:Buenas,
Estás seguro que tienes las liberías en el directorio correcto?, me explico, los .lib o .a correspondientes a las SDL y SDLmain los tienes en la carpeta lib del compilador? supongo que si, pero miralo por si acaso, creo que ese error tiene algo que ver con esto. Porque compilar compila no? quiero decir, lo que falla es el linker?
Un saludo.
PD: Si eso no te falta, cuelga el fichero del código y el makefile completo para poder mirarlo mejor si es posible, aunque creo que el error es más de la configuración o makefile en todo caso.
Gracias por la respuesta MiKeL SnAkE, ya comprobé la ubicación de las librerías, y asumo que están en el lugar correcto(/lib); en cuanto a mi main.cpp es este:
#include <math.h>
#include <SDL/SDL.h>
#include <pspkernel.h>
// Variables globales:
SDL_Surface *screen=NULL;
// Declaraciones de funciones adelantadas incluidas en este módulo de código:
int IniProgram();
/* Define the module info section */
PSP_MODULE_INFO("Circulo con SDL", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
/* Llamada de salida */
int exit_callback(int arg1, int arg2, void *common)
{
sceKernelExitGame();
return 0;
};
/* Llamada thread */
int CallbackThread(SceSize args, void *argp)
{
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Configura llamada thread y vuelve a su 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)
{
if(IniProgram()!=-1)
{
SDL_Flip(screen);
}
sceKernelSleepThread();
return 0;
};
/************************************************************/
int IniProgram()
{
SetupCallbacks();
//Iniciar SDL
if(SDL_Init(SDL_INIT_VIDEO)<0)
return -1;
//Modo de video (ancho,alto,bits de profundidad,vía SW ó HW)
screen=SDL_SetVideoMode(480,272,24,SDL_HWSURFACE);
if(screen==NULL)
return -1;
atexit(SDL_Quit);
return 1;
};
Como se nota,es sólo un ejemplo para probar SDL; este es mi makefile
TARGET = Sdl_Ejemplo
OBJS = main.o
MORE_CFLAGS = -G0 -O2 -Wall
CFLAGS = $(MORE_CFLAGS)
CXXFLAGS = $(MORE_CFLAGS) -fno-exceptions -fno-rtti
STDLIBS = -lSDL -lSDLmain -lpng -ljpeg -lz -lm -lpspsdk -lm
LIBS=$(STDLIBS)$(YOURLIBS) -LC:/pspdev/psp/lib -lSDL -lm -lGL -lpspvfpu
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = SDL Ejemplo
PSPSDK = $(shell psp-config --pspsdk-path)
PSPBIN = $(shell psp-config --psp-prefix)/bin
include $(PSPSDK)/lib/build.mak
Y nuevamente gracias por la ayda.