Results 1 to 8 of 8

Thread: Cannot compile objective-C under Mac

  1. #1
    Join Date
    Aug 2010
    Posts
    38

    Cannot compile objective-C under Mac

    Hello,
    That is my case:
    I am in training at the hospital and my topic is to make a plug-in for Osirix (a mac program that enables viewing of medical images in 3D, 4D, etc..). The trouble is that for the moment I have no Mac available to me (That's still the 3rd day I'm supposed to do the programming for mac. I must begin by familiarizing myself with the Objective-C (I know C), and for that I decided, if the mac, put me in Linux. Bad luck, it is a language primarily intended to run applications mac galley and I just find what it takes to compile and run under Linux (Ubuntu Gutsy). So I defer to your advice. I tried to install GNUstep (unsuccessfully, apparently installed it, but I found anywhere), I downloaded the library files for gcc (gobjc), but when compiling with:

    Code:
    gcc-x objective-c-o test test.m
    The program answers an endless number of lines. So there is some bug in the code. can you please help me fix this bug. Thank you.

  2. #2
    Join Date
    May 2008
    Posts
    255

    Re: Cannot compile objective-C under Mac

    Alternatively, to compile, rather I use this command line:
    Code:
    $ Gcc-machin.m lobjc-lpthread-o foo-
    # lobjc specifies that binds the binary runtime objc
    In OS X, should also specify the frameworks with the switch-framework (eg, framework Foundation) Bad luck, it is a language primarily intended to run applications mac, the Objective-C compiler is none other than Apple's GCC, the language itself is well supported under GNU / Linux. As in Cocoa, it is based on the open specification which is based OpenStep GNUstep, the original implementation was (and remains) platform. Objective-C was relatively popular among developers before GNOME2 GNOME. Otherwise, the objective-C is a very simple language and is learned very quickly if you are familiar with C.

  3. #3
    Join Date
    Aug 2010
    Posts
    38

    Re: Cannot compile objective-C under Mac

    I tried your command line to compile and the result is the same. I think the problem comes from my bibliographer (I recovered a little hard): I looked for the GNUstep folder / usr / include / folder and I copied the Foundation and all that contains history that the compiler has what it needs. Again, what seems strange is that all lines starting with "#", which would mean that the comments are not? I tried all of them out, and when compiling, it gives me one line:

    Code:
    $ / Usr / include / Foundation / Foundation.h: 27: error:
    Since I am more accustomed to using the libraries that build them, I am stuck there. Anyway, thank you for the time you devoted to me.

  4. #4
    Join Date
    Mar 2010
    Posts
    184

    Re: Cannot compile objective-C under Mac

    The # indicates a C preprocessor directive, please remove it, comments in C (ISO99) and Objective C is
    Code:
    / * My comment * / / / my comment valid in ISO C 99, but not in C GNU99 ISO 90
    The Objective-C is a strict superset of C, all that is valid in C is Objective-C. Yes, your library may be (your code is absolutely correct), but unless it has changed, GNUstep is in the Ubuntu repositories.

  5. #5
    Join Date
    Aug 2010
    Posts
    38

    Re: Cannot compile objective-C under Mac

    I searched a bit and I think it was a bad idea to just copy the folder Foundation. Is there no way to tell gcc Another possible location for the libraries (instead of fetch in / usr / include /, it will fetch more in / usr / include / GNUstep /)? Please provide more information on the same if possible.

  6. #6
    Join Date
    Nov 2009
    Posts
    356

    Re: Cannot compile objective-C under Mac

    You can do in a terminal:
    Code:
    PATH = / usr / include / GNUstep: $ PATH
    That way it will first look in / usr / include / GNUstep. You can try this.

  7. #7
    Join Date
    Aug 2010
    Posts
    41

    Re: Cannot compile objective-C under Mac

    Just like that, the GNUstep is supposed to give me a new linux environment or not? Because for the moment, despite having attended several different tutorials to install GNUstep (and all required libraries), I still have my basic environment (GNOME). Well there they finally found me a MAC, so I started programming in Objective-C Friday afternoon (after one week ), But I would like to continue at home on my linux from time to time.

  8. #8
    Join Date
    Aug 2010
    Posts
    40

    Re: Cannot compile objective-C under Mac

    GNUstep is an application framework but this is not an office itself. Finally, it goes better with wmaker because he has his own philosophy (no menu bar built into the window, but separate and common to all applications, only the application menu that has focus appears as NeXT and OS-X)

Similar Threads

  1. Replies: 5
    Last Post: 15-09-2011, 10:56 AM
  2. Which is the most played objective in Brink?
    By Anantram in forum Video Games
    Replies: 5
    Last Post: 19-05-2011, 10:21 AM
  3. HomeFront: Battle Points per Kill/objective
    By Enton Dou in forum Video Games
    Replies: 5
    Last Post: 14-03-2011, 10:23 AM
  4. Mutual Funds according to investment objective
    By Baijnath in forum Education Career and Job Discussions
    Replies: 3
    Last Post: 17-11-2010, 07:07 PM
  5. Parsing XML in Objective C
    By Sheravat in forum Software Development
    Replies: 4
    Last Post: 29-05-2010, 05:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,714,008,262.19693 seconds with 17 queries