Technical article 100778

Using fattach(), usleep() or expm1() results in "undefined symbol" linker error.

OpenServer 5.0.0

Written · Last revised

Problem

I am compiling a program that calls the system library routines fattach(S), usleep(S) and expm1(S), and I have specified the correct libraries to link according to the manual page for these library routine calls.

However, the compilation fails with an "undefined symbol" error message for these routines, such as:

$ cc myprog.c -lc -lm
undefined                       first referenced
symbol                             in file
fattach                             myprog.o
usleep                              myprog.o
expm1                               myprog.o
ld fatal: Symbol referencing errors. No output written to a.out

Solution

These library calls are defined as part of the X/Open Compatibility Guide Issue 4, Version 2 (XPG4.2), also known as "Spec-1170" or the X/Open "Single Unix Specification".

Currently, the SCO OpenServer Development System Release 5.0.0 fully conforms to the previous version of XPG4, and but not to Version 2.

Although documented, the library routines fattach(S), usleep(S) and expm1(S) are not currently included in any of the development libraries for SCO OpenServer Release 5.0.0.

The following Spec-1170 routines are not included in this product, but are declared in various system header files:

setjmp.h:
        _longjmp()
        _setjmp()
math.h:
        expm1()
        log1p()
unistd.h:
        fattach()       (also declared in stropts.h)
        gethostid()
        ualarm()
        usleep()
ucontext.h:
        makecontext()
        swapcontext()
stdlib.h:
        mkstemp()

These library routines are intended to be included in a future release of SCO OpenServer.

From the Xinuos technical article database, record 100778. Reproduced with permission. The original is at www.sco.com/ta/100778, which is reachable but blocked from search engines. Xinuos marks this article against a retired product line. That refers to the product’s lifecycle, not to whether the advice still works — plenty of it still applies to running systems.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.