Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/156.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 如何使用C++;20英寸g++;_C++_G++_C++20 - Fatal编程技术网

C++ 如何使用C++;20英寸g++;

C++ 如何使用C++;20英寸g++;,c++,g++,c++20,C++,G++,C++20,我正在尝试访问std::popcount,但它似乎是 当我尝试用g++-std=c++20 main.cpp编译时,它说g++:error:unrecogned命令行选项'-std=c++20';你是说'-std=c++03' 如何告诉G++使用C++ 20?< /P> 我正在使用Ubuntu 18.04,我会尝试更新gcc。C++ 20在GCC版本8中引入,这是很新的。您的版本G++< /C> >太老了。您至少需要9+才能编写popcount(这将是-std=c++2a)或10+才能真正编写c

我正在尝试访问
std::popcount
,但它似乎是

当我尝试用
g++-std=c++20 main.cpp
编译时,它说
g++:error:unrecogned命令行选项'-std=c++20';你是说'-std=c++03'

如何告诉G++使用C++ 20?< /P>
我正在使用Ubuntu 18.04,我会尝试更新gcc。C++ 20在GCC版本8中引入,这是很新的。

您的版本G++< /C> >太老了。您至少需要9+才能编写
popcount
(这将是
-std=c++2a
)或10+才能真正编写
c++20
。您使用的是什么版本的GCC?是吗?