PDA

View Full Version : Build settings




idelovski
Sep 23, 2009, 06:37 PM
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 (http://developer.apple.com/iphone/library/documentation/DeveloperTools/Conceptual/XcodeProjectManagement/210-Building_Products/building.html#//apple_ref/doc/uid/TP40002693-SW39) 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?



PhoneyDeveloper
Sep 23, 2009, 07:48 PM
Other C flags is present. Why do you think it's not?

idelovski
Sep 24, 2009, 02:45 AM
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.

PhoneyDeveloper
Sep 24, 2009, 08:52 AM
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?

idelovski
Sep 24, 2009, 11:07 AM
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.

PhoneyDeveloper
Sep 24, 2009, 11:50 AM
What is the base SDK setting? What happens if you set the Target SDK to match the base SDK setting?

idelovski
Sep 24, 2009, 01:07 PM
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.

PhoneyDeveloper
Sep 24, 2009, 03:04 PM
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.

idelovski
Sep 24, 2009, 03:52 PM
... 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.

dejo
Sep 24, 2009, 03:56 PM
I had enough calling selector for -justDoIt when I had -justDoIt: defined in my class.
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?

idelovski
Sep 24, 2009, 04:26 PM
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.

dejo
Sep 25, 2009, 01:03 AM
That switch turns this warning ON, not OFF.
Sorry then. My bad.