S
S
sitev_ru2015-01-28 13:25:07
C++ / C#
sitev_ru, 2015-01-28 13:25:07

How to make a C++ program compiled on CentOS 7 work on CentOS 6?

CentOS 7 development computer. How to get compiled C++ program to work on CentOS 6? Gives errors of mismatch of versions of libraries...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
H
hiloader, 2015-01-28
@hiloader

There are several options
1) Link the application with the -static flag. You will only have to use static third party libraries for this.
2) Build a cross-compiler in which build the same version of libc as in centos 6, then it will be possible to link with statics only c++ and gcc runtimes ( libstdc++.a, libgcc.a) through the flags -static-libgcc and -static- libstdc++
On the seven, glibc is older, and it has only top-down compatibility. Resolve the issue with her first.
3) Start a build server on 6-ke, let the release builds build there, build the compiler you need, the problem with glibc will disappear by itself. Well, yes, link runtimes with statics.

A
AxisPod, 2015-01-28
@AxisPod

Well, it's easier to put a virtual machine with CentOS 6 to the developer.

D
Don Kaban, 2015-01-28
@donkaban

1. First, show the output of ld
2. Then the output of objdump -T
If it is impossible to rebuild, transfer the necessary libraries to the target platform and make a sendbox.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question