Jason Schmidlapp | 30 Jun 03:16

Linker errors about ctype


I'm working with Agar on the PSP platform.  The library compiles OK, 
but I get some errors when I go to link it with a simple test 
application  of mine.  Here is an example of the errors I get:

usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib    
     /libag_gui.a(keymap_ascii.o):
In function `EmulateShiftUSKBD':
keymap_ascii.c:(.text+0x300): undefined reference to 
    `__ctype_b_loc'
keymap_ascii.c:(.text+0x410): undefined reference to 
    `__ctype_toupper_loc'

It also occurs in text.c and file_dlg.c

These are the only linker errors I get, so I'm assuming that the 
other Agar API calls are being correctly linked.  My test app and 
the Agar library are being built with the same version of the
toolchain, same support libraries, etc. 

Any ideas?  I'm stumped...

Thanks!
Julien Nadeau | 4 Jul 03:45
Favicon

Re: Linker errors about ctype

On Mon, Jun 30, 2008 at 01:19:05AM +0000, Jason Schmidlapp wrote:
> 
> I'm working with Agar on the PSP platform.  The library compiles OK, 
> but I get some errors when I go to link it with a simple test 
> application  of mine.  Here is an example of the errors I get:
> 
> usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib    
>      /libag_gui.a(keymap_ascii.o):
> In function `EmulateShiftUSKBD':
> keymap_ascii.c:(.text+0x300): undefined reference to 
>     `__ctype_b_loc'
> keymap_ascii.c:(.text+0x410): undefined reference to 
>     `__ctype_toupper_loc'
> 
> It also occurs in text.c and file_dlg.c
> 
> These are the only linker errors I get, so I'm assuming that the 
> other Agar API calls are being correctly linked.  My test app and 
> the Agar library are being built with the same version of the
> toolchain, same support libraries, etc. 
> 
> Any ideas?  I'm stumped...

Can you successfully compile and link a test program which uses some
ctype functions? Maybe it is a problem with libc. I think toupper(),
etc. is normally inline, but __ctype_b_loc is a global array which
should be defined in libc.
Jason Schmidlapp | 5 Jul 15:38

Re: Linker errors about ctype

Julien Nadeau <vedge@...> writes:

> 
> On Mon, Jun 30, 2008 at 01:19:05AM +0000, Jason Schmidlapp wrote:
> > 
> > I'm working with Agar on the PSP platform.  The library compiles OK, 
> > but I get some errors when I go to link it with a simple test 
> > application  of mine.  Here is an example of the errors I get:
> > 
> > usr/local/pspdev/lib/gcc/psp/4.1.0/../../../../psp/lib    
> >      /libag_gui.a(keymap_ascii.o):
> > In function `EmulateShiftUSKBD':
> > keymap_ascii.c:(.text+0x300): undefined reference to 
> >     `__ctype_b_loc'
> > keymap_ascii.c:(.text+0x410): undefined reference to 
> >     `__ctype_toupper_loc'
> > 
....
> 
> Can you successfully compile and link a test program which uses some
> ctype functions? Maybe it is a problem with libc. I think toupper(),
> etc. is normally inline, but __ctype_b_loc is a global array which
> should be defined in libc.
> 

I figured out the problem.  The ctype.h that was being included 
was NOT the one for my target (PSP) toolchain 
[/usr/local/pspdev/include/ctype.h], but rather my local host
 copy [/usr/include/ctype.h].

(Continue reading)


Gmane