PDA

View Full Version : getgrent_r on Redhat 7.2 and 7.3



Unregistered
05-23-2002, 07:22 PM
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 error:programname:symbol getgrent_r, version GLIBC_2.1.2 not defined in file libc.so.6 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?

Thanks.

Unregistered
05-24-2002, 08:25 AM
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...

Unregistered
05-24-2002, 08:15 PM
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?

Lynux-Penguin
05-25-2002, 11:14 AM
recompile or print code out and I'll se what might be causing this