Thread: getgrent_r on Redhat 7.2 and 7.3

  1. #1

    getgrent_r on Redhat 7.2 and 7.3

    I have an .exe that I want to run on various versions of linux (ie. Redhat 7.0, 7.1, 7.2, 7.3, etc. (and yes I realize that linux versioning has nothing to do with Redhat, but Redhat distros are what I'm working with)), and I want to avoid re-linking if possible. The image is linked against shared libraries. It works fine for 7.0 - 7.2, but then on 7.3 I get the error:

    programname:relocation errorrogramname:symbol getgrent_r, version GLIBC_2.1.2 not defined in file with link time reference

    Am I simply busted on this, ie must I recompile and/or relink? Or is there some neat trick to get around it?


  2. #2
    if you link to static libraries, you won't have any of those problems. my guess that libc was updated with 7.3 and the older library, which your program links to dynamically, isn't on the newer system...just a guess, but try to link statically or make sure the libraries are the same...

  3. #3
    Actually I was linking statically before, and that is even worse. When you link statically ( with 7.2 for instance) the executable only works when it's run on Redhat 7.2. Ok, well it runs on the others, but it hangs in system calls here and there. I think getgrent_r was a problem, and recv was a problem, and these problems appeared to go away after dynamic linking, so I thought this was the solution until I tried to run on 7.3! So....

    Thanks anyway for the suggestion. Any other ideas?

  4. #4
    Comment your source code! Lynux-Penguin's Avatar
    Join Date
    Apr 2002
    recompile or print code out and I'll se what might be causing this
    Asking the right question is sometimes more important than knowing the answer.
    Please read the FAQ
    C Reference Card (A MUST!)
    Pointers and Memory
    The Essentials
    CString lib

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Downloading RH 7.3
    By Barjor in forum A Brief History of
    Replies: 2
    Last Post: 05-07-2002, 05:42 AM