0

I've written a Linux program in C, and I'm trying to get it to run on a server system. It looks like everything should work, but when I try it, I get this:

/lib64/libc.so.6: version `GLIBC_2.14' not found (required by <program>)
/lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./libdbi.so.1)

(Where <program> is my program's name.)

So far as I can tell, my program only requires that version of GLIBC because libdbi does. I've tried compiling libdbi from source, and it still attempts to link to that version of GLIBC.

I don't own the server system (it's a shared system I run a website on, and have SSH access to), so I can't make any changes to it -- that's why the library file is in the same directory, and I've set LD_LIBRARY_PATH=.. Unfortunately I also don't have access to a compiler on it -- when I try to run GCC, I'm told "permission denied". It's run by a big corporation, and I'm only one customer; the chances of them making any changes at my request are essentially zero.

Is there any way to compile the program on my system so that it will work on the server?

Before I asked, I found these similar questions:

There are others, but they seem to be variations on those.

I'd be willing to use a non-free solution (like one that I saw in another answer I can't find now) if I turn this into a commercial product, but for a single use it seems like massive overkill, not to mention the expense.

Is there any way to simply tell libdbi to link to a later GLIBC version, maybe? If not, is there any solution I've overlooked?

Community
  • 1
  • 1
Head Geek
  • 38,128
  • 22
  • 77
  • 87

4 Answers4

2

You must compile it on a machine that has the same version of glibc as the target machine, or an older version. shared library compatibility works in that direction only.

2

Big corporation or not, the least they owe you if you are paying for service in any way or being paid for development to meet a requirement is a careful description of the runtime environment so you can duplicate it on a development machine.

Then you must set out to systematically duplicate this environment. Since you're using libdbi you should be thorough. Database connections can exercise big chunks of the system API, so you want to have exactly the same version of Linux, gcc (even if you can't run it, you need to know the version other parts of the system were compiled with), and other tools and libraries. If you don't, you won't be able to have much confidence that your development machine tests translate to good behavior on the target.

A virtual machine is a good way to create a specialized development environment without messing up your existing one.

Gene
  • 46,253
  • 4
  • 58
  • 96
  • Thanks. Turns out they're using CentOS6, which apparently only provide GLIBC 2.x versions through 2.12 -- I didn't realize that the libc backwards compatibility was broken up like that. :-( Anyway, I'm grabbing the install DVD image of that OS, I'll create a VM for it and try to compile it there. – Head Geek Oct 28 '13 at 20:40
1

Find out what version of Linux the server uses, get a copy of it and install it in a VM

Virtualbox is good for this

You can use this environment for testing code as well as this particular compilation problem

Vorsprung
  • 32,923
  • 5
  • 39
  • 63
0

You have the following options:

  • Compile your code on the server machine (which likely has gcc installed)
  • Compile your program with statically linked libraries (option -static for gcc)
Claudio
  • 10,614
  • 4
  • 31
  • 71
  • Thank you, but neither of those options are available. `libdbi` can't be compiled statically, and I don't have permission to use GCC on the server. See the original question for details on both of those. – Head Geek Oct 28 '13 at 14:55