![]() Select Settings -> Compiler -> Global compiler settings (large blue gear icon in the left pane) -> Toolchain executables tab.sudo apt install gcc-8-base # recommended version Optionally install the latest version of gcc too (recommended). Install the latest version of the g++ compiler for C++. The C++ compiler is not configured for any version of g++ in Ubuntu 18.04 by default, so it has to be configured in the Code::Blocks compiler settings. Check the option "Enable all common compiler warnings" (-Wall).Your C++ program is not running in Code::Blocks because you do not have a C++ compiler (a version of G++) installed, or if it is installed you have not configured the C++ compiler in the Code::Blocks compiler settings. Also to ensure C11 conformance, check the option "treat errors as the warnings demanded by ISO C." (-pedantic-errors).Click ok and check the new C11 option you just created. For "name" type in C11, for compiler flags type in -std=c11. In the tab Compiler settings, right click on the list of compiler flags and select "New flag".In the same tab, check that the C compiler is x86_64-w64-mingw32-gcc.exe (since you now might have multiple installations of GCC on your computer) and that the make program is mingw32-make.exe.Add the above path in Codeblocks, Settings -> Compiler -> Toolchain executables tab -> Compiler's installation directory.It will end up in some obscure folder like C:\Program Files\mingw-w64\x86_64-4.9.1-win32-seh-rt_v3-rev1\mingw64. Manually download the latest version of the Mingw 64 compiler (I don't think Mingw32 is maintained to include GCC versions of C11).Assuming Codeblocks 13.12 for Windows, it comes with an older version of GCC (4.7.1) that doesn't support C11.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |