我的设备上的 C++ 编译器版本是什么

what is c++ compiler version on my device

本文关键字:编译器 版本 是什么 C++ 我的      更新时间:2023-10-16

in cmd 我输入了g++ -v结果:

使用内置规范。 COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=C:/Program\ Files\ (x86(/CodeBlocks/MinGW/bin/../libexec/gcc/mingw32/5.1.0/lto-wrapper.exe 目标:明w32 配置: ../../../src/gcc-5.1.0/configure --build=mingw32 --enable-languages=ada,c,c++,fortran,lto,objc,obj-c++ --enable-libgomp --enable-lto --enable-graphite --enable-libstdcxx-debug --enable-threads=posix --enable-version-specific-runtime-libs --enable-full-dynamic-string --enable-libstdcxx-threads --enable-libstdcxx-time --with-gnu-ld --disable-werror --disable-nls --disable-win32-registry --disable-symvers --enable-cxx-flags='-fno-function-sections -fno-data-sections -DWINPTHREAD_STATIC' --prefix=/mingw32tdm --with-local-prefix=/mingw32tdm --with-pkgversion=tdm-1 --enable-sjlj-exceptions --with-bugurl=http://tdm-gcc.tdragon.net/bugs 螺纹型号:磅 GCC 版本 5.1.0 (TDM-1(

我想知道我的 c++ 版本是什么?是哪一个,C++11/C++14/C++17?

似乎您的编译器版本是 5.1.0(来自路径中的目录名称(

C++11、C++14 或 C++17 与下载的编译器版本无关。任何编译器都应该在其下载中包含编译器已实现的所有标准版本(正如Nicolas Dusart指出的那样,GCC 5.1.0最多只有C++14(。因此,您可以使用 -std={c++11, c++14, c++17} 标志指定要编译的语言规范。

例如,如果要使用 Concepts(c++20 功能(编译代码,则必须使用:

g++ main.cpp -o hello_world -std=c++20