0

I recently realized that Code::Blocks (I use 16.01) was not configured to use C++11 (nullptr), but that I also need at least C99 to be present instead of ANSI C. For some reason the Have gcc follow the 1999 ISO C language standard [-std=c99] and any of the g++ options can't both be selected at the same time. Also, the ANSI option is separate unlike the C99 one. Is this specific to this (Code::Blocks) version? I checked and this doesn't have the specific solution like others. I understand that I'm setting the std option, but these are two separate binaries and it doesn't seem justified.

Thanks for reaching out.

9
  • 2
    What are you really doing? Do you have a mixed-language project? Or are you trying to mix C and C++ in the same source files? What are the problems, errors, messages, etc. that you get, by the IDE or by the compilers? Commented Apr 1, 2024 at 9:53
  • 1
    C++ isn't C and the ANSI C++ standards are not synchronized with ANSI C standards. Mixing C++ and C was already a bad idea in 1992 when "Effective C++" was published, warning against that kind of code. Commented Apr 1, 2024 at 9:57
  • 1
    Just ignore the CB's checkboxes, and manually type in the flags. There's an "other flags" textbox somewhere in project settings. Commented Apr 1, 2024 at 9:59
  • 1
    When compiling C code use gcc with the appropriate flags for C. When compiling C++ code use g++ with the appropriate flags for C++. Commented Apr 1, 2024 at 10:00
  • 1
    If your compiler suite does not support at least C99 and C++11 by default, perhaps consider upgrading it. Commented Apr 1, 2024 at 11:20

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.