0

Before asking the question I want to clarify that I am an Android developer with no experience of Linux and C/C++ programming. The only way I know to build a C project on Linux is through Eclipse but given a pointer or details on doing it other way I will not hesitate. So something in the question below might look awkward.

I have an issue where I compiled a cpp project and made executable on Ubuntu 12.04 using Eclipse Indigo. It runs fine here. Now I have to use the same executable on a RH server where I get the error: lib64/libc.so.6: version `GLIBC_2.14' not found

I searched internet and using command ldd --version found that glibc version on my dev machine is 2.15 and on server is 2.12. Also the gcc version on my machine is 4.6.3 and on server is 4.4.6.

How can I make it run on server? I went thought of installing other version of glibc on my machine and build it with reference to this question: Multiple glibc libraries on a single host. But I do not understand what is going on here.

I can think of 2 ways of doing this either build the project such that the executable includes all the needed files with it or build it in a way that it runs on older version of library.

Please try to provide as much details to answer or at least a pointer to understand it, given my inexperience on the platform.

Community
  • 1
  • 1
Calvin
  • 617
  • 1
  • 12
  • 34
  • 1
    You are either going to have to upgrade glibc on the RH machine to at least 2.14, or you are going to have to build on the RH machine so that the binary expects to use glibc 2.12. You might be able to install backwards compatibility libraries on Ubuntu (and build and link with them) — I'm not sure about that and wouldn't really recommend it even if you could. – Jonathan Leffler Jan 22 '13 at 05:38
  • @Jonathan: Thanks for looking, but my server maintenance guy told me it will be troublesome to upgrade the lib as it may break something else also and because of something he described as dependencies he is not willing to risk it – Calvin Jan 22 '13 at 05:43
  • 1
    It can be tricky doing upgrades, and caution is often warranted. I'd hope/expect that you could upgrade leaving the original version in situ, but I've not tried it recently. Get yourself a machine with the down-version RH on it (a virtual machine, perhaps) and compile there. Then copy to the production server. – Jonathan Leffler Jan 22 '13 at 05:46
  • @Jonathan: yes getting another machine with down version is a good option :) – Calvin Jan 22 '13 at 05:51

1 Answers1

0

I copied my project files on the RH server and built the project there itself. Working fine..

Calvin
  • 617
  • 1
  • 12
  • 34