Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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
1  
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
1  
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

1 Answer 1

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

 
discard

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.