Build settings

Discussion in 'iOS Programming' started by idelovski, Sep 23, 2009.

  1. idelovski macrumors regular

    Joined:
    Sep 11, 2008
    #1
    How do I set GCC build settings of an iPhone Project, namely Other C Flags? This item is present in Mac Cocoa/Carbon projects, but I can't find it in iPhone projects.

    If I look at this screenshot in Apple's documentation it is different than Inspector window in my project. My project misses the whole GCC Code generation section.

    I wanted to add -Wundeclared-selector flag I found in GCC documentation but I can only do it in the Inspector for each ObjC file, not on a project level. Any ideas?
     
  2. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #2
    Other C flags is present. Why do you think it's not?
     
  3. idelovski thread starter macrumors regular

    Joined:
    Sep 11, 2008
    #3
    Well, then something's wrong with my Xcode...

    But it's good to hear that it might fix itself if I upgrade Xcode or when I move to SnowLeopard.
     

    Attached Files:

  4. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #4
    Whatever is wrong it's most likely your project, not Xcode and I don't think you need to upgrade to fix it.

    The screenshot you show is missing the GCC Language settings.

    What happens if you build a project from a template, say the navbar template? Does it build and run? Does it show the GCC Language settings?

    What Base SDK have you set?
     
  5. idelovski thread starter macrumors regular

    Joined:
    Sep 11, 2008
    #5
    Thanks for reply, but I don't think we can do anything about it without some kind of upgrade.

    All of my iPhone projects (40 or so) are created with one of the templates, all of them build just fine and run on both a device and in simulator. None of them (OK, I checked in 7 or 8 actually) displays GCC section in the build settings. Even the projects I downloaded from the web don't display GCC related info, so it must be something with my Xcode.
     
  6. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #6
    What is the base SDK setting? What happens if you set the Target SDK to match the base SDK setting?
     
  7. idelovski thread starter macrumors regular

    Joined:
    Sep 11, 2008
    #7
    Yes, this did it. Thank you for your patience!

    When I set active target to mach the Base SDK then GCC section magically reappears.

    So many times I tried to run projects when they were set to Device SDK when noting was connected to my Mac, only to look at infamous Unexpected error dialog. Now I always switch back to Simulator before closing a project.

    What a strange problem. Xcode is really some funny piece of software.
     
  8. PhoneyDeveloper macrumors 68030

    PhoneyDeveloper

    Joined:
    Sep 2, 2008
    #8
    It's a bug. I don't know if it's fixed on SL, since I haven't installed it yet.

    If the target SDK and the Base SDK don't match then all the GCC settings go to the bottom of the prefs window and you see them as raw settings.
     
  9. idelovski thread starter macrumors regular

    Joined:
    Sep 11, 2008
    #9
    ... or completely disappear as with my version of Xcode. Anyway, thanks to you I can now enjoy the newfound warning switch. I had enough calling selector for -justDoIt when I had -justDoIt: defined in my class.
     
  10. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #10
    Why not define it so that it doesn't seem undeclared? That is, readjust your coding to make the warning go away rather than just "plugging your ears" and not listening to it?
     
  11. idelovski thread starter macrumors regular

    Joined:
    Sep 11, 2008
    #11
    Not sure I understand completely what you suggest.

    But, I want compiler to warn me if I don't have method declared if I'm passing its selector somewhere. I don't think you can call that "plugging your ears". That switch turns this warning ON, not OFF.
     
  12. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #12
    Sorry then. My bad.
     

Share This Page