Author Topic: Objective-C  (Read 7976 times)

Birdeeoh

  • Guest
Objective-C
« on: January 28, 2006, 10:51:11 pm »
Adding syntax highlighting for Objective-C is a simple addition to the current lexer_cpp.xml file and thats great - but what about "full" support for Objective C, namely having Code Blocks realize that a *.m file is a "source" file, not an "other" file?

As it is now I can manually tell codeblocks to compile and link my .m "other" files, one by one.  Since the GCC compiler handles both regular C and Obj-C it would simply be a matter of convincing CodeBlocks that .m is a c source file.  If there is any easy way to do this, I've missed it...  thanks for your help!


Offline Der Meister

  • Regular
  • ***
  • Posts: 307
Re: Objective-C
« Reply #1 on: January 28, 2006, 10:55:38 pm »
If there is any easy way to do this, I've missed it...
Yes, you missed it. ;)
Just do a 'right-click' in the 'Management'-window and select 'Edit file types & categories...'. There you can add *.m to the file-endings for source files. ;)
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

Birdeeoh

  • Guest
Re: Objective-C
« Reply #2 on: January 29, 2006, 03:49:47 am »
Yup, that sure was easy.

Out of curiosity, is/was there a menu option I missed?

I was checking menus and right-clicking on text to try to find an option - never thought to right-click in open space  :)

Thanks for your quick help!

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Objective-C
« Reply #3 on: January 29, 2006, 04:10:23 am »
Out of curiosity, is/was there a menu option I missed?

I was checking menus and right-clicking on text to try to find an option - never thought to right-click in open space  :)
Well, there's Project-->Project tree-->Edit filetypes & categories.  "Project tree" is the same here as it is in the "Management" right-click menu.

Birdeeoh

  • Guest
Re: Objective-C
« Reply #4 on: January 29, 2006, 08:50:58 pm »
Welp, the problem was kinda fixed, but not really.  Whether I use the rightclick menu or the project-> menu, I can get *.m classified as source.  Great!  However, when I add a new *.m to my project it still does not automatically have "compile" and "link" checked.  It gets classified as a source file, but is greyed out and not included in my build until I manually check those boxes!

Sorry if I'm asking questions I should be able to figure out...  it's just that this is the first "real" IDE I've ever used.  I'm from the vi + console windows developer ilk and am just foraying into this full-blown deal so I don't know where I should look.  Where I think I should be looking obviously isn't  right  ;)

Thanks again for the help!

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Objective-C
« Reply #5 on: January 30, 2006, 03:32:26 am »
Welp, the problem was kinda fixed, but not really.  Whether I use the rightclick menu or the project-> menu, I can get *.m classified as source.  Great!  However, when I add a new *.m to my project it still does not automatically have "compile" and "link" checked.  It gets classified as a source file, but is greyed out and not included in my build until I manually check those boxes!
This is actually an issue that has been raised before, although I'm not sure it was really brought to the attention of any of the devs.  See, for example, http://forums.codeblocks.org/index.php?topic=1786.msg13399#msg13399 and http://forums.codeblocks.org/index.php?topic=2023.0.  I agree with you strongly that the filetypes that default to compileable and linkable should be user-configurable, possibly even from that same "Edit file types & categories" dialog that you just discovered.
Anyone looking for a little project to take on?  :lol:  (I would try this myself, but my machine runs the compiler so slowly, it's frightening.)