gpt4 book ai didi

c++ - _GLIBCXX_USE_CXX11_ABI 在 RHEL6 和 RHEL7 上禁用?

转载 作者:行者123 更新时间:2023-12-02 02:54:41 26 4
gpt4 key购买 nike

我在 RHEL6 和 RHEL7 上安装了 gcc 5.2.1,并且看起来 _GLIBCXX_USE_CXX11_ABI 被禁用。即使我手动运行 -D_GLIBCXX_USE_CXX11_ABI=1 -std=c++14 也不起作用。这意味着我不会获得小字符串优化功能。例如,以下代码的输出始终为 8 和“micro not set”。对于 SSO,如果我们查看代码 bits/basic_string.h,std::string 的大小应至少为 16。有什么解决办法吗?

#include <string>
#include <iostream>

int main()
{
std::cout << sizeof(std::string) << std::endl;

#if _GLIBCXX_USE_CXX11_ABI
std::cout << "macro set" << std::endl;
#else
std::cout << "macro not set" << std::endl;
#endif

}

最佳答案

bugzilla.redhat已回复如下

Jakub Jelinek 2018-02-19 06:08:00 EST

We've tried hard, but it is not possible to support this, neither on RHEL6 nor on RHEL7, which is why it is forcefully disabled. It will work in RHEL8 (and be the default there as well).

关于c++ - _GLIBCXX_USE_CXX11_ABI 在 RHEL6 和 RHEL7 上禁用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50836145/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com