Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

One of my client runs a glibc-2.7 based system , and my static linked program wasn't able to start on the target machine, raising an error:

_ZNSt7num_getlcSt19istreambuf_iteratorIcSt11char_traitsIcEEE2idE, version GLIBCXX_3.4

So I'm wondering if I can use LD_PRELOAD and passing on the glibc on the develop machine? And if it's possible, what file should be copied there?

share|improve this question
If your executable is failing because of unresolved symbols, it's not statically linked. And as pointed out by Ignacio, that's not a libc symbol, but a C++ symbol (libstdc++). The safest way to handle this is to build against the same version of libraries that your client has. (Or really statically linking.) – Mat Jan 8 '12 at 7:35
@Mat , yeah i'm going to rebuild a gentoo system with everything static linked , that should solve the issue – warl0ck Jan 8 '12 at 8:37
Woah! Don't build a statically-linked distro, that would be mayhem. Just build your code statically (-static, -static-libgcc, -static-libstdc++ - potentially huge exes though). – Mat Jan 8 '12 at 8:51
@Mat , it's a graphic program .. Qt based , that's really kinda hell .. just build Qt may cost 2 hours – warl0ck Jan 8 '12 at 9:48
up vote 1 down vote accepted

You'd probably find it more productive to either preload or static-link libstdc++ instead.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.