| View previous topic :: View next topic |
| Author |
Message |
hectic128
Joined: 17 Nov 2007 Posts: 12
|
Posted: Sat Jun 28, 2008 12:07 pm Post subject: undefined reference to `__ctype_b_loc' |
|
|
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! |
|
| Back to top |
|
 |
Hellcat
Joined: 24 Jan 2007 Posts: 84
|
Posted: Sat Jun 28, 2008 7:44 pm Post subject: |
|
|
| Looks like you didn't put the agar lib into the LIBS= line in the makefile.... |
|
| Back to top |
|
 |
hectic128
Joined: 17 Nov 2007 Posts: 12
|
Posted: Sat Jun 28, 2008 11:41 pm Post subject: |
|
|
| Hellcat wrote: | | Looks like you didn't put the agar lib into the LIBS= line in the makefile.... |
Nope, it's there.
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. |
|
| Back to top |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
Posted: Wed Jul 02, 2008 4:50 am Post subject: |
|
|
Check Google.
__ctype_b_loc looks like a peculiarity of Linux libc/glibc; it's defined by the Linux Standard Base specification. PSP is not Linux and you'll have to define those symbols yourself if you want them. |
|
| Back to top |
|
 |
hectic128
Joined: 17 Nov 2007 Posts: 12
|
Posted: Wed Jul 02, 2008 11:28 am Post subject: |
|
|
| OK, I figured out the problem. When building the library, it was grabbing the ctype.h file from /usr/include rather than the PSP toolchain one... |
|
| Back to top |
|
 |
|