On Sep 29, 11:15 pm, f...@securityaudit.val.newsbank.net (Dick
Wesseling) wrote:
> In article <1191000544.790678.290...@g4g2000hsf.googlegroups.c om>,
> wong_po...@yahoo.ca writes:> I got an link error for undefined reference to `__ctype_b' and
> > `__ctype_tolower'.

>
> ...
> > /usr/lib/libUtility.so: undefined reference to `__ctype_tolower'
> > /usr/lib/libUtility.so: undefined reference to `__ctype_b'
> > collect2: ld returned 1 exit status
> > make: *** [RASMain] Error 1

>
> > How to fix this problem?

>
> Re-link libUtility.so and use an explicit "-llibc.so"
>
> The symbol table for libc.so contains versioned symbols for __ctype_xxxx.
> If the linker encounters such a symbol it will replace the external
> reference to - for example - __ctype_b with a reference to
> __ctype_b@@GLIBC_2.0. The latter is supported by all versions of
> libc.so.


libUtility.so is created by
ar -r libUtility.so MemoryBlock.o ... MemoryQueueClass.o HexDump.o

Therefore I tried:
ar -r libUtility.so MemoryBlock.o ... MemoryQueueClass.o HexDump.o
/usr/lib/libc.so

(This will create an error:
ar -r libUtility.so MemoryBlock.o ... MemoryQueueClass.o HexDump.o-
llibc.so
ar: -llibc.so: No such file or directory)

There is still compile error:
g++ -O -O0 -DOS_LINUX -DOS_UNIX -DLITTLE_ENDIAN -DUSE_PTHREADS -O -o
RASMain RASMain.o RASServer.o /usr/lib/libpopt.so ./.libs/libHw.al -L/
usr/lib -lUtility -ldl /usr/lib/libc.so
/usr/lib/libUtility.so: undefined reference to `__ctype_tolower'
/usr/lib/libUtility.so: undefined reference to `__ctype_b'
collect2: ld returned 1 exit status
make: *** [RASMain] Error 1