Code: Select all
#include <stdio.h>
#include <pspkernel.h>
/* Define the module info section */
PSP_MODULE_INFO("TEST", 0, 1, 1);
/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);
int main(void)
{
tmpnam("");
return 0;
}
Code: Select all
TARGET = test
OBJS = main.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS = -lpsputility
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Test
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Code: Select all
$ make
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -L. -L/usr/local/pspdev/psp/sdk/lib main.o -lpsputility -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpsputility -lpspuser -lpspkernel -o test.elf
/usr/local/pspdev/lib/gcc/psp/4.0.2/../../../../psp/lib/libc.a(tmpnam.o): In function `worker':
../../../../../newlib/libc/stdio/tmpnam.c:121: undefined reference to `_sprintf_r'
collect2: ld returned 1 exit status
make: *** [test.elf] Error 1