
You don't need to do anything else to it. This will automatically get selected when you change the other options and if you close the dialog before you uncheck it, you'll have to go back and change it, then close and reopen the file in the viewer before you can edit it.Ģ) When you add a header file ( *.h), you'll also need to open up its properties window and change the compiler variable to CC. Before you close the dialog, go to General and uncheck File is read-only. Under Build, select both Compile file and Link file. Under advanced, change the compiler variable to CC. Whenever you add or create a new ObjC source ( *.m) in your project, you must right-click on it and go to Properties. For reasons beyond my understanding, GCC will sometimes (albeit rarely) complain during complex builds if this isn't the last argument on the line.ġ) By default, C::B will select CPP as the default compiler variable for a new source file, and the file will not be compiled or linked to a target. For Link object files to executable and Link object files to console executable, move -o $exe_output to the end of the macros. If ObjC still refuses to build properly for you, you can use this to compare the command line arguments C::B uses against the commands you would use if you were building the program manually on the command line.ģ) Under Other Settings, go to Advanced Options.
Code blocks gcc compiler full#
Optional Changesġ) Go to Settings->Compiler and dubugger.Ģ) Under Other Settings, change Compiler logging to Full command line. Note: if you feel so inclined, you could create a new custom lexer. Keywords id BOOL YES NO SEL nil NULL self (next to Filemasks.) and create a new set (up arrow). Add *.m to the list of filetypes.ģ) Go to Keywords. This makes setting up a new compiler very simple, as we can make a copy of the standard compiler and change the linker settings.Ĭaution: Make sure your GNU GCC Compiler is properly setup before attempting to setup for Objective-Cġ) Go to Settings->Compiler and debugger.Ģ) Select GNU GCC Compiler and make a copy it name it whatever you like, but " GNU GCC Obj-C Compiler" would be the most descriptive.ģ) Under Linker Settings, add -lobjc to Other linker options you don't need to explicitly add the libobjc.a library, as the flag tells gcc to include it for us.Ģ) Select Files extension handling and add *.mģ) Go to Project->Project tree->Edit file types & categories.Ĥ) Under Sources, add *.m to the list of filetypes.Ģ) Select Syntax highlighting and go to Filemasks. Use "." button beside "C Compiler" to set the correct exe nameħ.Objective-C is a strict superset of C the additional functionality is obtained by linking to the Objective-C library when building using the standard GNU GCC Compiler. Use "." button to set path to the MinGW GCC Compiler folder that contains the bin sub folder.Ħ. Second way to fix issue does NOT erase any customized settings for this Compiler.ĥ. Click on "Set as Default" Optional but strongly recommend step.įirst and faster way to fix issue erases any customized settings for this Compiler. Select "GNU GCC Compiler" in "Selected Compiler" listģ. NOTE: You must have a good MinGW GCC Installation on your ComputerĢ. Hint: Goto "Settings->Compiler and debugger.->Global compiler settings->GNU GCC Compiler->Toolchain executables" and fix the compiler's setup. The compiler's setup (GNU GCC Compiler) is invalid
