Home Help Center

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

JohnBJohnB Member John BasraiOrganization: VeriFoneProject: Trident ✭✭
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 `[email protected]_PRIVATE'
/lib/librt.so.1: undefined reference to `[email protected]_PRIVATE'
/lib/librt.so.1: undefined reference to `[email protected]_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?


  • mesmes CaliforniaAdministrators, ZeroC Staff Mark SpruiellOrganization: ZeroC, Inc.Project: Ice Developer ZeroC Staff
    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.

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    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,
Sign In or Register to comment.