【KeyarchOS】安装GCC&&Glibcxx_3.4.20实践

解决 GLIBCXX 版本不匹配的问题 解决 GLIBCXX 版本不匹配错误的步骤:查找 GLIBCXX 版本、确定对应 GCC 版本、下载源代码、编译安装 GCC、替换系统库文件、更新链接器缓存。按此解决方案,您能解决 "/lib64/libstdc++.so.6: version `GLIBCXX_x.x.xx' not found (required by ./appname)" 类似错误。详细步骤指导您在目标机器上重新编译代码,使用与目标机器 GLIBCXX 版本相符的 GCC 版本。解决 GLIBCXX 版本不匹配问题,请参考本文指南。 阅读详情

目录

1 概述

2 安装准备

2.1 操作系统环境

2.2 Glibcxx版本

3 安装

3.1 安装gcc

3.2 安装gcc-c++

4 使用Glibcxx

4.1 编写测试程序


1 概述

浪潮信息KOS是浪潮信息基于Linux Kernel、OpenAnolis等开源技术自主研发的一款服务器操作系统,支持x86、ARM等主流架构处理器,性能和稳定性居于行业领先地位,具备成熟的 CentOS 迁移和替换能力,可满足云计算、大数据、分布式存储、人工智能、边缘计算等应用场景需求。详细介绍见官网链接浪潮信息云峦服务器操作系统KeyarchOS_KOS服务器操作系统-浪潮信息

Glibcxx,也称为GNU C++库,是GNU计划的一部分,它提供了C++标准库的实现。它是GCC(GNU编译器集合)的一部分,用于支持C++编程语言。Glibcxx是一个开源项目,旨在提供与ISO/IEC C++标准兼容的功能,包括容器、算法、迭代器、字符串处理、输入/输出等。它在基于C库(glibc)的基础上进行扩展,提供了许多C++特定的功能和类。使用Glibcxx可以方便地编写跨平台的C++代码,支持多种操作系统和体系结构。Glibcxx还提供了丰富的文档和示例代码,以帮助开发人员快速上手并有效地使用库的功能。详细介绍见官网链接https://gcc.gnu.org/。

2 安装准备

2.1 操作系统环境

版本信息:KeyarchOS 5.8sp1

硬件平台:X86_64

2.2 Glibcxx版本

Glibcxx-3.4.20

3 安装

3.1 安装gcc

1、查看gcc版本,若无gcc,先安装:

使用GLIBCXX_3.4.20对于gcc的版本要求为4.8及以上,默认安装的版本为8.5,符合使用要求。

安装后查看版本:

3.2 安装gcc-c++

1、使用yum命令直接安装gcc-c++:

yum install gcc-c++

2、查看系统已安装的所有GLIBCXX版本:

strings /usr/lib64/libstdc++.so.6 | grep GLIBCXX

 

 可以看到,Glibcxx_3.4.20已被安装。

4 使用Glibcxx

4.1 编写测试程序

1、创建c++程序文件test.cpp

2、保存后编译:

g++ test.cpp -o testprogram

 生成可执行文件testprogram:

3、运行testprogram

./testprogram

可以看到,程序正常运行,说明gcc编译成功。

CentOS 7.6 下 “GLIBCXX_3.4.20” "GLIBCXX_3.4.21" not found CentOS 7.6 下运行程序,出现如题错误,通过ldd 查看该so 文件依赖库,也报同样错误: 通过 strings /lib64/libstdc++.so.6 | grep GLIBC 查看,发现当前系统最高GLIBCXX 为3.4.19, 需要升级。 1. 查看当前gcc 版本 gcc -v 2. 升级gcc 版本 2.1 安装所需工具: yum... 阅读详情

相关推荐

version `GLIBCXX_3.4.20‘ not found问题,glibc依赖问题解决方案汇总

在linux操作系统中运行程序是出现version `GLIBCXX_3.4.20‘ not found问题的解决方案。

啊渊的专栏 3511

version `GLIBCXX_3.4.20‘ not found 解决方法

查阅了网上的解决方法,都说要更新libstdc++.so.6,按照教程操作,一直没有成功,最后参考了好几篇文章,综合了大家的方法,成功更新了,特用此贴,记录过程。更新了hisat2的版本后,运行出现了2个错误,

qq_33238907的博客 2645

libstdc++.so.6.0.20 含GLIBCXX_3.4.15 - GLIBCXX_3.4.20

Ubuntu 12.04.5, 64-bit,libstdc++.so.6.0.20。可以用于解决类似“/opt/MATLAB/R2012a/bin/glnxa64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by ./programName)”的错误。详细用法见我博客:http://blog.csdn.net/arackethis/article/details/42365573

解决报错‘version `GLIBCXX_3.4.20‘ not found’

报错: 运行时程序时出现了以下错误: version `GLIBCXX_3.4.20' not found (required by node) version `GLIBCXX_3.4.21' not found (required by node) 运行以下命令检查动态库: strings /usr/lib64/libstdc++.so.6 | grep GLIBC 部分输出如下: GLIBCXX_3.4 GLIBCXX_3.4.1 GLIBCXX_3.4.2 GLIBCXX_3..

zhangyingna667的博客 2万+

学习Python,小白如何搭建Python环境?

学习Python,首先需要搭建好Python环境,主要分为【运行环境搭建】、【开发环境搭建】以及【Python环境配置】三个环节,接下来我将对Python环境搭建这三个部分进行介绍。

weixin_72923265的博客 9003

手把手教你用FreeModbus RTU协议栈实现STM32与PLC通信(附Keil工程)

本文详细介绍了如何使用FreeModbus RTU协议栈在STM32上实现与PLC的工业通信。从环境搭建、工程配置到关键移植接口实现,提供了Keil工程模板和调试技巧,帮助开发者快速掌握Modbus RTU通信技术,适用于工业自动化领域的设备间通信需求。

weixin_42549037的博客 419

【工具搭建】个人知识库trilium超详细攻略 解决version `GLIBCXX_3.4.20‘ not found问题

我在网上冲浪的时候看到了Trilium,之前一只有意搭建自己的私有知识库,苦于没找到合适的开源软件,正好手头有台服务器闲着,就拿来搭建试试。Trilium 的介绍都可以在github上找到,还有wiki有需要可以看看

星火飞花 1万+

MATLAB实战:5步搞定GNSS单点定位解算(附完整代码)

本文提供了一份基于MATLAB的GNSS单点定位实战指南。通过5个核心步骤,详细讲解了如何从卫星坐标和伪距观测值出发,利用最小二乘迭代算法,构建并实现一个完整的单点定位解算器。文章附有完整代码,并涵盖精度评估与结果分析,适合GNSS初学者和MATLAB用户快速上手实践。

a2b3c4d5e的博客 250

linux需要的GLIBCXX版本,Linux下GLIBCXX和GLIBC版本低造成的编译错误的解决方案

最近在给编译环境centOS 6.5安装新版clang (clang 3.4/3.5)的时候,虽然已经装了gcc 4.9.1, 但编译的时候(参考clang官方主页http://clang.llvm.org/get_started.html的步骤,在独立build目录下运行clang自带的configure脚本),仍然出了“c compilercannot create executables”的...

weixin_42484858的博客 4538

SEED-VIG数据集实战:5步搞定驾驶员疲劳检测模型(附Python代码)

本文提供了一份基于SEED-VIG数据集的驾驶员疲劳检测模型实战指南。通过五个核心步骤——数据准备、特征提取、模型训练、优化评估及部署思路,详细讲解了如何利用脑电信号构建分类器,并附有完整的Python代码,帮助开发者快速上手这一智能座舱关键技术。

w1x2y3的博客 263

TortoiseGit提示No supported authentication methods available错误

一、问题 在使用TortoiseGit与远程仓库进行同步代码的时候提示如下错误,即:没有支持认证的方法可用。而GitBash却可以正常使用,不受影响。 通过调查,发现应该是TortoiseGit远程仓库的公匙无法和本地的密匙进行匹配认证造成的(主要是TortoiseGit缺少本地密匙)。由于TortoiseGit的默认网络SSH client是TortoiseGitPlink.exe,如下图所示。因此主要有两种方式来解决该问题: 不修改TortoiseGit的默认网络SSH client,此时需要为To

Jeffxu_lib的博客 2万+

Linux-GLIBCXX版本过低导致编译错误--version `GLIBCXX_3.4.20' not found

ubuntu系统下,运行python程序时出现如下问题: OSError: /home/chenyanyin/anaconda2/bin/../lib/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by /home/chenyanyin/anaconda2/lib/python2.7/site-packages/ale_

Merdy_xi的博客 7383

Mixer-First Receiver适用于宽带阵列应用的接收机技术1

Mixer-First Receiver适用于宽带阵列应用的接收机技术1技术的背景单元级数字化阵列传统链路到Mixer-First链路的逻辑考虑三种场景小结 技术的背景 在文章《吊打全球的顶级毫米波数字阵列项目-MIDAS》中提到了DARPA在MIDAS项目中在毫米波实现宽带单元级数字化阵列用到了一个关键的叫做N-Path filter的技术,而这个技术同样出现在了《让微波射频工程师颤抖的芯片-MATRICs》的MATRICs芯片中。 为什么DARPA的各个合作研究机构选择这种技术?这篇来自Universi

ICONO的博客 2167

安装GLIBCXX_3.4.21和GLIBC_2.18

检查动态库,发现没有GLIBCXX_3.4.21: $ strings /usr/lib64/libstdc++.so.6 | grep GLIBC 查看libstdc++.so.6的位置: $ find / -name libstdc++.so.6* 列出与libstdc++.so.6相关的文件,可以看到当前动态连接库版本是libstdc++.so.6.0.19: /usr/lib64/libstdc++.so.6.0.19 /usr/lib64/libstdc++.so.6 /usr/share/g

北枫林 8267

脑电时频分析I:谱分析

1、EEG频带划分 自发的EEG活动在活体大脑中持续存在,通常通过频率进行分类(也叫神经振荡活动) 特定频段的脑活动,即节律性的活动,具有特定的头皮分布和生物学意义 最后还有一个γ波,主要是指30hz~100hz的一个波段,通常这个波段也包含了噪声唁电的成分,比较难提取处理,比较少用到这个波段 这个波段主要是有可能躯体感觉皮层,进行一个多通道的感觉输入的i信号处理,比如我们同时处理视觉和听觉信号的处理,而且γ波与我们记忆的形成有关 除此之外,还有一个特殊的波段,8~12hz的Mu波段主要是特指我们

Kobe123brant的博客 1万+

nRF52811墨水屏时钟DIY:从全刷到局刷的实战改造指南(附完整代码)

本文详细介绍了如何将基于nRF52811的墨水屏时钟从耗电的全屏刷新模式改造为高效的局部刷新模式。通过剖析全刷与局刷的原理差异,提供了从工程架构、驱动层适配到应用层逻辑重构的完整实战指南,并附上关键代码示例。改造后,设备功耗显著降低,续航大幅提升,同时解决了视觉闪烁问题,是DIY低功耗墨水屏应用的实用参考。

weixin_29194693的博客 355

linux需要的GLIBCXX版本,linux系统下的缺失 libstdc++.so.6: version’GLIBCXX_3.4.20’的问题:...

在linux下遇到了一个这样的问题,使用anaconda时,它的安装库里的文件被提示:缺失 libstdc++.so.6: version’GLIBCXX_3.4.20’。后来经过查看资料知道了原来是由于 libstdc++.so.6的版本过低造成的;再重新找一个高版本的就可以了;由于GCC的版本其实很高的,所以呢,我认为我的电脑的其它文件的库文件里应该有比这版本高的;所以,在自己的电脑里找找;问...

weixin_34766547的博客 1138

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

【debug】报错ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20‘ not found

非root用户解决报错:/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20’ not found

向上生长的程序媛的博客 4411

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain&#39;s apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath(&#39;DeepLearnToolbox&#39;));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand(&#39;state&#39;,0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W&#39;); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand(&#39;state&#39;,0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = &#39;sigm&#39;;%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, &#39;Too big error&#39;);```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand(&#39;state&#39;,0)sae = saesetup([784 100]);sae.ae{1}.activation_function = &#39;sigm&#39;;sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)&#39;)% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;;nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, &#39;Too big error&#39;);```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x&#39;,28,28,60000))/255;test_x = double(reshape(test_x&#39;,28,28,10000))/255;train_y = double(train_y&#39;);test_y = double(test_y&#39;);%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you&#39;ll get around 1.2% errorrand(&#39;state&#39;,0)cnn.layers = { struct(&#39;type&#39;, &#39;i&#39;) %input layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 6, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %sub sampling layer struct(&#39;type&#39;, &#39;c&#39;, &#39;outputmaps&#39;, 12, &#39;kernelsize&#39;, 5) %convolution layer struct(&#39;type&#39;, &#39;s&#39;, &#39;scale&#39;, 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, &#39;Too big error&#39;);```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, &#39;Too big error&#39;);%% ex2 neural net with L2 weight decayrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex3 neural net with dropoutrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex4 neural net with sigmoid activation functionrand(&#39;state&#39;,0)nn = nnsetup([784 100 10]);nn.activation_function = &#39;sigm&#39;; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex5 plotting functionalityrand(&#39;state&#39;,0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = &#39;softmax&#39;; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand(&#39;state&#39;,0)nn = nnsetup([784 20 10]); nn.output = &#39;softmax&#39;; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, &#39;Too big error&#39;);```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

libstdc++ GLIBCXX_3.4.20 not found 解决方法

背景:不想升级gcc,太累了。参考如下文章:下载这个zip。

norsd的专栏 447

蓝牙模块HM-10手册

蓝牙模块HM-10手册,该手册对蓝牙模块HM-10进行了详细的介绍和使用方法以及一些AT指令。

Centos/redhat下GLIBCXX_3.4.20的问题

编译一些软件的时候会出现类似如下问题: rror: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found undefined reference to `std::__cxx11::basic_stringbuf<char, std::char_traits<char>, std::allocator<char> >::_M_sync(char*, unsigned long, unsigned lo

4167

conda环境下“/lib64/libstdc++.so.6: version `GLIBCXX_3.4.20‘ not found”问题解决

从错误中分析可知,报错发生在/lib64/libstdc++.so.6,是GLIBCXX_3.4.20找不到所致。拷贝高版本的libstdc++.so到/usr/lib64目录下,并重新建立软连接。连接到linux系统的libstdc++.so.6.0.19。2.3 查看本地所有的“libstdc++.so.6”本地确实没有GLIBCXX_3.4.20。

十年以上架构设计经验,专注于软件架构和人工智能领域,对机器视觉、NLP、音视频等领域都有涉猎 1万+

glibcxx、glibc、libstdc++、GCC和g++之间的关系

这些组件在软件开发中各自扮演不同的角色,但彼此之间相互依赖,共同构成了GNU/Linux和其他类Unix系统中软件开发的基础。

SmileHergo的博客 2113
上一篇: KOS系统安装部署Calico网络
下一篇: kos安装k3s v1.19.8部署实践教程
KeyarchOS
博客等级 码龄3年 1312粉丝 339原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值