Archived

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

undefined reference from /lib/librt.so.1 on Linux

I'm trying to get a simple project to link on Linux and I'm getting the following errors.
slice2cpp --checksum arrow.ice
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/librt.so.1: undefined reference to `__librt_enable_asynccancel@GLIBC_PRIVATE'
/lib/librt.so.1: undefined reference to `__librt_multiple_threads@GLIBC_PRIVATE'
/lib/librt.so.1: 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
nptl-devel-2.3.4-2.39

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

What am I doing wrong?

Comments

  • 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.

    Regards,
    Mark
  • 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,
    Bernard