I'm trying to compile a program that uses an external library (agar) and am getting some strange errors that I can't figure out. They all look something like:
keymap_ascii.c:(.text+0x300): undefined reference to `__ctype_b_loc'
OR
keymap_ascii.c:(.text+0x410): undefined reference to '__ctype_toupper_loc'
Has anyone ever run across anything like this? This one has me stumped...
A few more data points:
The library and app are being built with the same version of the toolchain (and SDK libraries, etc).
As far as I know, there's nothing special about the way the library is being built (e.g. no weird compiler or linker flags).
Here's the command line when I link it, if that helps.
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2 -Wall -g -I.. -fno-strict-aliasing -I../.. -I/usr/local/pspdev/psp/include/agar -I/usr/local/pspdev/psp/include/SDL -I/usr/local/pspdev/psp/include -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib cp.o -lag_gui -lag_core -lSDL -lpspgu -lfreetype -lpspaudio -lpsphprm -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o cp.elf
Thanks!
undefined reference to `__ctype_b_loc'
Nope, it's there.Hellcat wrote:Looks like you didn't put the agar lib into the LIBS= line in the makefile....
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -G0 -O2 -Wall -g -I.. -fno-strict-aliasing -I../.. -I/usr/local/pspdev/psp/include/agar -I/usr/local/pspdev/psp/include/SDL -I/usr/local/pspdev/psp/include -D_PSP_FW_VERSION=150 -L. -L/usr/local/pspdev/psp/sdk/lib cp.o -lag_gui -lag_core -lSDL -lpspgu -lfreetype -lpspaudio -lpsphprm -lm -lpspdebug -lpspdisplay -lpspge -lpspctrl -lpspsdk -lc -lpspnet -lpspnet_inet -lpspnet_apctl -lpspnet_resolver -lpsputility -lpspuser -lpspkernel -o cp.elf
Plus, all of the other agar symbols link OK, its just these ctype ones.