This forum has been archived. Please start a new discussion on GitHub.

undefined reference from /lib/ on Linux

I'm trying to get a simple project to link on Linux and I'm getting the following errors.
slice2cpp --checksum
g++ -c -I/usr/include/nptl -I. -fexceptions icemain.cpp ArrowSvc.cpp arrow.cpp
g++ -o ArrowSvc *.o -L/usr/lib/nptl -lpthread -L/usr/lib -lIce -lIceUtil

/lib/ undefined reference to `__librt_enable_asynccancel@GLIBC_PRIVATE'
/lib/ undefined reference to `__librt_multiple_threads@GLIBC_PRIVATE'
/lib/ undefined reference to `__librt_disable_asynccancel@GLIBC_PRIVATE'

I checked if nptl is installed on this machine and this is what rpm says:
rpm -query nptl-devel

I think this is RHEL 4 but I do not know how to check.

What am I doing wrong?


  • mes
    mes California
    Hi John,

    Are you using the RPMs that we provide, or did you build Ice from source?

    If you're not sure which version of Linux you are using, check in /etc for a file whose name ends in release. This text file describes the distribution.

    For Linux distributions that we don't officially support, we strongly recommend compiling Ice from source. You can download the source code and patches for Ice's third-party dependencies on our web site.

  • bernard
    bernard Jupiter, FL
    You may just need to add -lrt:
    g++ -o ArrowSvc *.o -L/usr/lib/nptl -lpthread -lrt -L/usr/lib -lIce -lIceUtil

    If you're using RHEL 4 or a RHEL 4 clone (CentOS 4, Scientific Linux 4), the simplest is to install our RPMs for RHEL 4 ... the 3.3.1 RPMs since we no longer support RHEL 4 with Ice 3.4: ZeroC - Download - Ice 3.3.1

    Best regards,