eosio-cpp 运行错误的问题解决

在学习官方的合约教程时遇到下面问题:
编译智能合约时候提示下面的错误
eosio-cpp error

看上去是因为libstdc++的版本不够新吧
先采用的办法是重新编译安装更新版本的gcc-7.3, 没能解决这个问题
又去网上找到这个办法

作者:imperfect00

来源:CSDN

原文:https://blog.csdn.net/u011961856/article/details/79644342

和我的遭遇很像,试了一下
解决方法:

安装libstdc++,

sudo apt-get install libstdc++6

输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
libstdc++6 is already the newest version (5.4.0-6ubuntu1~16.04.10).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

不行啊,类似这种已经是最新版本的提示真的好让人烦燥,一直不懂得怎么去解决,还要去好好 学习下ubuntu的软件源怎么使用才好呀
还好这位博主还有Plan B:

如果还未解决,则可以终端运行如下命令:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test 
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade

完全不懂得在搞什么事情,应该是更新软件源并且下载更新某些软件吧
log很多,网络不大好的话可能会很慢,
dist-upgrade还可能会出现错误:

#...  ...  a lot of logs not posted here
E: Failed to fetch http://ppa.launchpad.net/ubuntu-toolchain-
r/test/ubuntu/pool/main/g/gcc-5/gcc-5-base_5.5.0-12ubuntu1
~16.04_amd64.deb  Connection timed out
E: Unable to fetch some archives, maybe run apt-get update
 or try with --fix-missing?

那么就再试一次吧,过了,好幸运:

#...  ...  a lot of logs not posted here
Setting up libquadmath0:amd64 (8.1.0-5ubuntu1~16.04) ...
Setting up libgcc-5-dev:amd64 (5.5.0-12ubuntu1~16.04) ...
Setting up gcc-5 (5.5.0-12ubuntu1~16.04) ...
Setting up libstdc++-5-dev:amd64 (5.5.0-12ubuntu1~16.04) ...
Setting up g++-5 (5.5.0-12ubuntu1~16.04) ...
Setting up libobjc4:amd64 (8.1.0-5ubuntu1~16.04) ...
Setting up libobjc-5-dev:amd64 (5.5.0-12ubuntu1~16.04) ...
Setting up gcc-6-base:amd64 (6.5.0-2ubuntu1~16.04) ...
Processing triggers for libc-bin (2.23-0ubuntu10) ...

最后再运行命令

strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX

#...  ...  other more logs not posted here
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_DEBUG_MESSAGE_LENGTH

看到了GLIBCXX_3.4.22, 这下应该没有什么问题了
再次用cdt编译下合约,好了哦,没有什么问题了!
vscode project profile

猜你喜欢

转载自blog.csdn.net/u011802646/article/details/85160456
今日推荐