开发生产libc / libstdc ++不匹配[链接libc.so.6 / libstdc ++。so.6与旧版本] [英] Dev production libc/libstdc++ mismatch [link libc.so.6/libstdc++.so.6 with older version]

查看:721
本文介绍了开发生产libc / libstdc ++不匹配[链接libc.so.6 / libstdc ++。so.6与旧版本]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C ++上构建了一个exec,但是当我将它部署到部署机器时,我会发现以下错误:`



/ lib64 / libc .so.6:未找到版本GLIBC_2.14
/usr/lib64/libstdc++.so.6:未找到GLIBCXX_3.4.14版本
/usr/lib64/libstdc++.so.6:版本CXXABI_1。 3.5 not found



原因是部署机器是基于rhel的系统,具有旧的libc(2.12)/ libstdc ++我的机器是Ubuntu的最近的内核和库。不幸的是我不能升级部署系统。



我尝试了一些常见的方式来处理这个问题,比如静态链接将我的库版本复制到集群(并使用LD_PRELOAD和-Wl, - rpath选项运行),但它不工作。我也在我的机器上安装了一个旧版本的gcc,但也不工作。 / p>

有一些方法可以让这个工作(也许在我的本地机器上创建目标代码,并链接到其他机器上)。或者是有一种方法来在部署机器上编译代码而不将源代码复制到它。
这可以与从部署机器获取系统库的副本,并尝试获取gcc与他们链接? (任何问题,以及如何正确地执行此操作)



相关于使用较旧的libc(未找到'GLIBC_2.14'版本)部署到Heroku,不能静态构建
在不同版本的Linux和glibc上构建和运行C ++代码



我知道有一种方法可以通过虚拟机这样做,但我想避免它(HT Mat)

解决方案

使用 -static-libstdc ++ 选项编译应用程序。


I built an exec on C++, however when I deploy it to the deployment machine I find errors like :`

/lib64/libc.so.6: version GLIBC_2.14 not found /usr/lib64/libstdc++.so.6: version GLIBCXX_3.4.14 not found /usr/lib64/libstdc++.so.6: version CXXABI_1.3.5 not found

This turns out because the deployment machine is rhel based system with older libc(2.12)/libstdc++(3.4.13) while my machine is ubuntu with far recent kernel and libraries. Unfortunately I cannot upgrade the deployment system.

I tried some of the usual ways to handle this like static linking (libc fails) and copying my library versions to the cluster (and run with LD_PRELOAD and -Wl,--rpath options) , but it doesn't work.I also installed an older version of gcc on my machine, but that also doesn't work.

Is there some way I can get this to work (perhaps making object code on my local machine,and linking it on the other machine). Or is there a way to compile the code on the deployment machine without copying source to it. Could this work with getting a copy of system libraries from deployment machine and try to get gcc to link with them? (any issues with that, and how to do that correctly)

Related to Compile with older libc (version `GLIBC_2.14' not found) and Deploying Yesod to Heroku, can't build statically and Build and run C++ code on different version of Linux and glibc

I am aware of one way to do this via VM , but I want to avoid it if possible.(HT Mat)

解决方案

Compile you application with -static-libstdc++ option.

这篇关于开发生产libc / libstdc ++不匹配[链接libc.so.6 / libstdc ++。so.6与旧版本]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆