| View previous topic :: View next topic |
| Author |
Message |
Shine
Joined: 03 Dec 2004 Posts: 728 Location: Germany
|
Posted: Tue Nov 01, 2005 5:45 pm Post subject: "undefined reference to _sprintf_r" in latest tool |
|
|
When I compile this:
| Code: |
#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;
}
|
with this Makefile:
| Code: |
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
|
I'll get this error:
| Code: |
$ 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
|
Same error in Lua Player, which doesn't compile any more with the latest PSPSDK (or at least with my local environment, if this is the bug). |
|
| Back to top |
|
 |
mrbrown
Joined: 17 Jan 2004 Posts: 1536
|
Posted: Thu Nov 03, 2005 9:33 am Post subject: |
|
|
| Looks like tmpnam() is violating newlib conventions and calling _sprintf_r() (instead of sprintf()) directly. I'm currently out of town, when I get back Friday I can fix it if no one else gets to it by then. |
|
| Back to top |
|
 |
|