Topic
1 reply Latest Post - ‏2011-09-15T06:12:43Z by SteLa
SteLa
SteLa
2 Posts
ACCEPTED ANSWER

Pinned topic C-ISAM 7.2 undefined reference error at link

‏2011-09-13T13:11:38Z |
Hi,

I have a problem that occurs when linking C-ISAM lib (libisam.a) using "gcc 4.1.2" and "glibc 2.5".
The project I'm currently working on involves porting an old application that uses C-ISAM, from a 32-bit to a 64-bit RHEL.

The build script runs the following line:

cc -m32 lilog.o read_ll_text.o \ .... (application specific libs) \ -lisam \ -o ../bin/lilog


The errors i get when trying to link are the following:

/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib/libisam.a(osctype.o): In function `ldctypearr
': osctype.c:(.text+0x129): undefined reference to `__ctype_b
' osctype.c:(.text+0x1c3): undefined reference to `__ctype_tolower
' osctype.c:(.text+0x1ea): undefined reference to `__ctype_toupper
' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib/libisam.a(glsutill.o): In function `_gl_skip_whitespace
': glsutils.c:(.text+0xe0c): undefined reference to `__ctype_b
' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib/libisam.a(glsutill.o): In function `_gl_get_int
': glsutils.c:(.text+0xf0c): undefined reference to `__ctype_b
' glsutils.c:(.text+0xf71): undefined reference to `__ctype_b
' glsutils.c:(.text+0xfcc): undefined reference to `__ctype_b
' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib/libisam.a(glsutill.o): In function `_gl_get_dbl
': glsutils.c:(.text+0x103f): undefined reference to `__ctype_b
' /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../lib/libisam.a(glsutill.o):glsutils.c:(.text+0x10a9): more undefined references to `__ctype_b
' follow collect2: ld returned 1 exit status


I have tried several different approaches but none that worked (Using gcc 3.4.6, including libc(-lc)).
Everything compiles and links on the old system (32-bit and gcc 2.96).
Apparently the __ctype_b, __ctype_tolower and __ctype_toupper are no longer available in glibc 2.5.

Is there anyone who can come up with a solution to get this through the link process?

Regards / Stefan
Updated on 2011-09-15T06:12:43Z at 2011-09-15T06:12:43Z by SteLa
  • SteLa
    SteLa
    2 Posts
    ACCEPTED ANSWER

    Re: C-ISAM 7.2 undefined reference error at link

    ‏2011-09-15T06:12:43Z  in response to SteLa
    I've found a solution, not exactly sure if this solution is going to work when it comes to using the binary though... (I have more compile errors on other modules that needs to be solved before I can test it).
    What I did was to make a copy of libc.a from the old 32-bit machine and put a renamed copy (libc.old.a) in my compile directory and included this when I linked the program.
    This step made the code link without errors but I will need to get back to you about if it worked or not...