Hello!
Installed codeblocks-20.03-32bit-mingw-32bit-setup.exe . In a simple program:#include <iostream>
#include <filesystem>
#include <map>
#include <string>
using namespace std;
namespace fs = filesystem;
int main()
{
setlocale(LC_ALL, "Russian");
map <string, unsigned int> map_ext;
for (const fs::directory_entry& dir_entry : fs::recursive_directory_iterator("N:\\TestProgramExt\\"))
{
if (fs::is_regular_file(dir_entry))
{
string ext = fs::path(dir_entry).extension().string();
++map_ext[ext];
}
}
for (auto&& [ext, num] : map_ext)
std::cout << ext << "\t" << num << std::endl;
std::cin.get();
return 0;
}
I get errors when installing compilation options (C++2020 standard):-------------- Build: Debug in cbCppStudy (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -std=gnu++20 -c N:\MyProgramming\cppStudy\cppStudy.cpp -o obj\Debug\cppStudy.o
mingw32-g++.exe -o bin\Debug\cbCppStudy.exe obj\Debug\cppStudy.o
mingw32-g++.exe: error: unrecognized command line option '-std=gnu++20'; did you mean '-std=gnu++2a'?
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
-------------- Build: Debug in cbCppStudy (compiler: GNU GCC Compiler)---------------
mingw32-g++.exe -Wall -fexceptions -std=c++20 -c N:\MyProgramming\cppStudy\cppStudy.cpp -o obj\Debug\cppStudy.o
mingw32-g++.exe -o bin\Debug\cbCppStudy.exe obj\Debug\cppStudy.o
mingw32-g++.exe: error: unrecognized command line option '-std=c++20'; did you mean '-std=c++2a'?
Process terminated with status 1 (0 minute(s), 0 second(s))
1 error(s), 0 warning(s) (0 minute(s), 0 second(s))
This program compiles without errors in Visual Studio 2022, but I work more often in CodeBlocks.
Please help me solve the problem.