在Ubuntu 15.10上用g ++-4.9编译时出现运行时错误[abi:cxx11] [英] Runtime error [abi:cxx11] when compile with g++-4.9 on Ubuntu 15.10

查看:366
本文介绍了在Ubuntu 15.10上用g ++-4.9编译时出现运行时错误[abi:cxx11]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近将Ubuntu从15.04更新到了15.10。这些版本之间的主要区别之一是从gcc-4.9-> gcc-5更新了默认gcc版本。我正在开发的库是针对gcc-4.9编写和编译的,并且依赖于仅在gcc-4.9中可用的其他库。

I recently updated Ubuntu from 15.04 to 15.10. One of the major differences between these versions is the update of the default gcc version from gcc-4.9 -> gcc-5. The library I'm developing has been written and compiled for gcc-4.9, and relies on other libraries which only work in gcc-4.9.

我已经在计算机上安装了gcc-4.9,并且可以成功编译库和源文件。但是,当我尝试运行结果程序时,出现此错误:

I have installed gcc-4.9 onto my computer, and I can successfully compile both the library and my source file. However, when I tried to run the resultant program I get this error:

terminate called after throwing an instance of 'std::ios_base::failure[abi:cxx11]'
what():  basic_ios::clear: iostream error
Aborted (core dumped)`

源代码以及我在此处尝试读取的文件在升级之前可以正常工作。我已经尝试过使用 -D_GLIBCXX_USE_CXX11_ABI = 0 标志,但是我不确定这是正确的做法,也行不通。

The source code, and the file I'm trying to read here used to work before the upgrade. I have tried using the -D_GLIBCXX_USE_CXX11_ABI=0 flag, but I'm not sure this is the right thing to do, also it doesn't work.

这是我当前包含在我的makefile中的标志的示例:

This is an example of the flags I'm currently including in my makefile:

CPPFLAGS = -O0 -g3 -Wall -c -fpermissive -D_GLIBCXX_USE_CXX11_ABI=0 -std=c++0x -fPIC -MMD -MP

有什么想法可以帮助我吗?

Any ideas that might help me out?

推荐答案

您简单地需要重新编译您的程序需要的一切都是C ++。

You "simply" need to recompile everything your program needs that is C++.

请参见例如有关交易的Debian Wiki ,其中(尤其是)

See eg the Debian wiki on the transision which has (inter alia)


好消息是,现在的GCC 5提供稳定的libcxx11 ABI,并稳定支持C ++ 11(5之前的GCC版本称为此受支持的实验)。这需要对libstdc ++ ABI进行一些更改,现在libstdc ++ 6提供了双重ABI,经典的libcxx98 ABI和新的libcxx11(GCC 5(<5.1.1-20)仅提供了经典的libcxx98 ABI) 。坏消息是,经典libcxx98 ABI和新的稳定libcxx11 ABI中的(实验)C ++ 11支持不兼容,并且上游不提供升级路径,除非重建

The good news is, that GCC 5 now provides a stable libcxx11 ABI, and stable support for C++11 (GCC version before 5 called this supported experimental). This required some changes in the libstdc++ ABI, and now libstdc++6 provides a dual ABI, the classic libcxx98 ABI, and the new libcxx11 (GCC 5 (<< 5.1.1-20) only provides the classic libcxx98 ABI). The bad news is that the (experimental) C++11 support in the classic libcxx98 ABI and the new stable libcxx11 ABIs are not compatible, and upstream doesn't provide an upgrade path except for rebuilding

没有捷径。

这篇关于在Ubuntu 15.10上用g ++-4.9编译时出现运行时错误[abi:cxx11]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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