Author Topic: Error after Installation of Code::Blocks 20.03  (Read 2499 times)

Offline GShauffenburg

  • Single posting newcomer
  • *
  • Posts: 2
Error after Installation of Code::Blocks 20.03
« on: December 06, 2021, 04:20:20 pm »
Hello group,

I am new to Code::Blocks and have uninstalled and the reinstalled the latest release (20.03) several times, with a reboot each time, but cannot resolve my issue.  I am working through the examples for C++ ALL-IN-ONE for dummies and am getting the following message after installing the latest release:
=== Build: Debug in VariadicTemplate (compiler: GNU GCC Compiler) ===
error: unrecognized command line option '-std=gnu++20'; did you mean '-std=gnu++2a'?
=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===

Did I miss something when I performed the install or is there something else that I need to install in addition to Code::Blocks?  I have checked and there is no option for a C++20 compiler and the complier selected is C++17 GNU C++ language standard (ISO C++ plus GNU extensions).   So I am not sure where the gnu++ 20 is even coming from.

Any help or suggestions in how to diagnose and resolve this issue would be greatly appreciated.

Regards,

Graham

Offline BlueHazzard

  • Developer
  • Lives here!
  • *****
  • Posts: 3090
Re: Error after Installation of Code::Blocks 20.03
« Reply #1 on: December 06, 2021, 05:26:54 pm »
For compilation errors please always follow this guide:
http://wiki.codeblocks.org/index.php?title=FAQ-Compiling_(general)#Q:_How_do_I_report_a_compilation_problem_on_the_forums.3F

The installed compiler does not support this option. Places where this option can be set:

  • Project->Build options->Select the project name on the left->Compiler flags
  • Project->Build options->Select the project name on the left->Other compiler options
  • Project->Build options->Select your build target on the left->Compiler flags
  • Project->Build options->Select your build target on the left->Other compiler options
  • Settings->Compiler->Global compiler settings->compiler settings->Compiler flags
  • Settings->Compiler->Global compiler settings->compiler settings->Other compiler options

Offline gd_on

  • Lives here!
  • ****
  • Posts: 688
Re: Error after Installation of Code::Blocks 20.03
« Reply #2 on: December 06, 2021, 06:27:32 pm »
If you installed C::B 20.03 with the official installer, you have certainly also installed gcc 8.1. This version of compiler was built in 2018. As far as I remember, c++20 or gnu++20 was not still available, but you should have gnu++2a effectively, which should work for you. If you really need gnu++20, you should update the compiler with a more recent version, for example the one provided with Msys2. Have a look in the codeblocks manual where you can eventually find other informations.
Windows 10 64 bits (21H2), svn C::B (last version or almost!), wxWidgets 3.1.5, Msys2 Compilers 11.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (sjlj, posix in C:\msys64\mingw32).

Offline GShauffenburg

  • Single posting newcomer
  • *
  • Posts: 2
Re: Error after Installation of Code::Blocks 20.03
« Reply #3 on: December 06, 2021, 07:58:51 pm »
Thank you for the help.

Somehow there was a setting added to the Other Compiler Options tab that was causing my issue.

Everything is working again.