How to use C++ 20 in g++(如何在 g++ 中使用 C++ 20)
问题描述
我正在尝试访问 std::popcount,但它似乎是 仅在 C++ 20 中存在.
I am trying to access std::popcount, but it seems like it's only there in C++ 20.
当我尝试使用 g++ -std=c++20 main.cpp 进行编译时,它显示 g++: error: unrecognized command line option '-std=c++20';你是说'-std=c++03'
When I try compiling with g++ -std=c++20 main.cpp, it says g++: error: unrecognized command line option '-std=c++20'; did you mean '-std=c++03'
我如何告诉 g++ 使用 c++ 20?
How do I tell g++ to use c++ 20?
我使用的是 Ubuntu 18.04
I am using Ubuntu 18.04
推荐答案
我会尝试更新 gcc.C++ 20 是在非常新的 gcc 版本 8 中引入的.
I would try updating gcc. C++ 20 was introduced in gcc version 8 which is pretty new.
这篇关于如何在 g++ 中使用 C++ 20的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何在 g++ 中使用 C++ 20
基础教程推荐
- C++实战之二进制数据处理与封装 2023-05-29
- 全面了解C语言 static 关键字 2023-03-26
- centos 7 vscode cmake 编译c++工程 2023-09-17
- [c语言-函数]不定量参数 2023-09-08
- 带你深度走入C语言取整以及4种函数 2022-09-17
- C语言实现宾馆管理系统课程设计 2023-03-13
- C语言 详解字符串基础 2023-03-27
- C++实现ETW进行进程变动监控详解 2023-05-15
- [C语言]二叉搜索树 2023-09-07
- C语言编程C++旋转字符操作串示例详解 2022-11-20
