LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   "libc.so.6: version `GLIBC_2.4' not found" when running library on different machine (https://www.linuxquestions.org/questions/linux-newbie-8/libc-so-6-version-%60glibc_2-4-not-found-when-running-library-on-different-machine-585720/)

mventimi 09-19-2007 01:38 AM

"libc.so.6: version `GLIBC_2.4' not found" when running library on different machine
 
I am trying to run a customized version of the GD graphics library from a Perl script on my web page, which is hosted by another company. To do this, I downloaded GD, the libraries on which it depends, and the Perl GD interface module to my FC6 machine. I then made the edits I need and built and installed everything. Everything works on my machine, as verified by a test script that I wrote.

I then grabbed the entire blib directory that I built and moved it to my web server. It fails with the following (I have CGI::Carp qw(fatalsToBrowser) turned on so that it displays to the web page):


Software error:

Can't load '/home/markve65/public_html/cgi-bin/blib/arch/auto/GD/GD.so' for module GD: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by /home/mventimi/public_html/cgi-bin/blib/arch/auto/GD/GD.so) at /usr/lib/perl5/5.8.8/i686-linux/DynaLoader.pm line 230.
at testGD.pl line 12
Compilation failed in require at testGD.pl line 12.
BEGIN failed--compilation aborted at testGD.pl line 12.


The Perl script dies at line 12, which is the "use GD;" line. If I comment this out, the script runs fine.

My first guess was that I built the library on a machine with a newer version of libc than what was on my web server machine. I checked my web server and it's running RHL9, so I grabbed a copy of RHL9, installed it on a free machine, and rebuilt as above. When I did that, however, the script died with a 500 error, and I get a "Premature end of script headers" in the error log.

The obvious answer would be to build this library on the web server machine, but I don't have access to do that. I need to build the library on a different machine and copy it over there. Can anyone give me any hints as to how I can do that? From what I've been able to dig up so far, I'm having a problem because glibc uses symbol versioning and I'm building my library on a machine with a newer glibc. The library then expects these newer versions of symbols on the machine with the older glibc. Is there any way to force the linker to use the older versions of symbols in glibc? Or am I completely off base here?

cmnorton 09-27-2007 07:15 AM

Find, Build if Necessary And Install
 
You need to find the library you want by searching for it. Some distros like Fedora and Ubuntu (probably others, too with which I have no experience) make it easy for you to get.

You should be able to get it as source or a distro-specific (Red Hat/Debian) installable package. The nice thing about linux is you can have several library versions. Just make sure your library environment variables include GBLIC_2.4's path.

If you cannot get a binary installation package, you'll need to build from source. In that case, you'll need the most common build tools, gcc, make, and so on. With most source packages, there is usually a very well written README file.


All times are GMT -5. The time now is 04:05 AM.