Feature #5720 2014-01-23 18:27

jimp

Support for Objective-C on Mac

Support for Objective-C on Mac

I have recently set up CodeBlocks 13.12 on Mac to work with Objective-C source. No program changes were necessary. With a few changes it could be done automatically. Without Objective-C there is limited capability on the Mac.

Objective-C can also be used on Windows or Linux with the addition of the GNUstep package. But it only works with compilers that support Objective-C. The ones I know of outside of Mac are MinGW and GCC. And the Objective-C compiler package must be installed on these. I don’t know how useful it would be outside of Mac.

The following describes the changes that were necessary to set up Objective-C on Mac. The LLVM Clang compiler was used. I assume it would work the same with GCC.

After creating a project containing Objective-C source code, I tried to open an Objective-C file in CodeBlocks. It didn’t recognize the file extension of “.m”. I selected “Open it inside the CodeBlocks editor”. Then right clicked on the Objective-C file name and selected “Properties”. Check the “Compile file” and “Link file” options. This is all that was needed to compile and run the program.

The syntax highlighting needs to be changed also. Objective-C has an “.m” extension which is currently assigned to Matlib. It must be removed from Matlib and added to Objective-C. Then the syntax highlighting seemed to be the same as C/C++ without any changes.

This is all that was necessary to use Objective-C on the Mac.

There seems to be quite a few people who don’t like Xcode. It would be good to have a cross-platform IDE like CodeBlocks that could be used with Objective-C on the Mac. And it looks like the changes would not be extensive.

Category
Programming Languages
Status
Open
Close date
 
Assigned to