"Other C Flags" in Xcode 4 Cocoa Static Library project - iphone

in Xcode 4, I created a sub project in my iOS project and made it a "Cocoa Static Library". In the Project/Target Build Settings, there is no option for "Other C Flags". Actually, there are no compiler options at all. Can anyone explain why this is?

Is the Basic option selected on the upper left instead of all?

Related

Can't include FMOD on iOS

I don't think I'm including the FMOD library correctly. I'm getting the following XCode error:
expected specifier-qualifier-list before FMOD
I'm using XCode 4 and the latest version of the FMOD library. I went into the "Link Binaries With Libraries" section in XCode and added libfmodex_iphonesimulator.a.
Any ideas on what I could be doing wrong?
Thanks!
Here is a step-by-step process for getting FMOD running in an iOS application:
File -> New Project
iOS -> Application -> Window based application
Choose name and location (I used 'test' and the FMOD examples directory as the location)
Assuming you named the app 'test', rename 'testAppDelegate.m' to have the extension '.mm' to allow C++ code.
Edit 'testAppDelegate.mm' to have #import "fmod.hpp" at the top.
Project -> Edit project settings (ensure Configuration at the top is set to All configurations)
Go to "Other linker flags" and type in -lfmodex_$PLATFORM_NAME
Go to "Header search paths" and type in ../../api/inc
Go to "Library search paths" and type in ../../api/lib (now close settings).
Right click on the "Frameworks" group on the left, choose Add -> Existing Frameworks, then choose 'CoreAudio.framework'
Repeat step 10 but choose 'AudioToolbox.framework'
Add FMOD code to 'testAppDelegate.mm' as needed, see playSound example for reference code.
After you link the appropriate library make sure you drag the 'inc' folder with all of the .h files into your project somewhere, that was my issue. Also, make sure you include AudioToolbox and CoreAudio if you did not already, and make sure to include fmod.hpp and fmod_errors.h in your view controllers header.

Forcing Xcode 4 to compile XIB into NIB

I upgraded an Xcode 3 project having three targets to Xcode 4. My targets' bundles no longer have any NIB files -- only XIB files. A new Xcode 4 project has both (at least in the simulator). I don't see any difference between the old and the new Xcode projects' settings to account for this difference.
How do I get Xcode 4 to compile the XIB files and put NIBs in my bundle?
Solution: Select all of the XIB files, change the file type to something outlandish ("Objective-C Preprocessed Source" is handy), and then set the file type BACK to the Default type (IB CocoaTouch XIB). De-select all of the files (Xcode might spin on that for a while), clean the project, delete the prior version(s) from the simulator(s), and now the build should contain only NIBs, no XIBs.
Man Always Wins In The End. (With help from BaldEagle.)
I found another solution:
Go into the 'Build Settings' or your project target, look for 'Other Interface Builder Compiler Flags' and add the flag '-all'.
That's it.

XCode 3.2.4 Project - no "other linker flags" in build settings visible

I am recently trying to connect my cocos2d game with open feint, but I can't accomplish it as there seem to be some settings missing in my build settings of any project that I create.
For example, I have to check "Call c++ Default ctors/Dtors in objective c", but there isn't such an option in my build settings. What's wrong with that?
Here is a picture:
http://img413.imageshack.us/img413/3425/bildschirmfoto20101023u.png
My project is the one on the left, I downloaded the right one. I need to my build settings to like like the ones on the right. Is that somehow possible?
In the image, you have the build settings windows set to show "settings defined at this level". Since you haven't yet changed the other linker flags setting, naturally it doesn't show up. If you show all settings, you should see it.

Setting GCC 4.2.1 options in Xcode

I have a few questions about Xcode and interaction with GCC 4.2.1:
It doesn't seem as if Xcode Target Properties inspector exposes all possible GCC options. Is this correct?
More specifically, I'm interested in setting the "mfpu" option, as mentioned in the arm_neon.h intrinsics header. Is this possible or supported? Or perhaps set as a side-effect of some other Xcode setting?
If anyone has tried this or can post some resources, it would help a lot.
There are not checkboxes or menus available each option presented by the compiler, however you can enter any flags you'd like passed to the compiler in the "Other C Flags" field of the Target inspector.
Just set "Other C Flags" to "-mfloat-abi=softfp -mfpu=neon" and you'll be set.

Objective C -std=c99 usage

Is there any reason why you shouldn't use the "-std=c99" flag for compiling Objective-C programs on Mac? The one feature in C99 that I really like is the ability to declare variables anywhere in code, rather than just at the top of methods, but does this flag causes any problems or create incompatibilities for iPhone or Cocoa apps?
Compiled C99 binary code is binary-compatible with older C variants. The only downside is if you have to share code with other projects that aren't C99 (or GNU99).
The same applies to Objective-C
I've tried it myself on a small iPhone app, and it works. I've seen no problems with it.
A good way to do this if your project settings aren't letting you do it is to add a User-Defined setting. To do so:
Open your "Project -> Edit Project Settings" menu item.
at the bottom left, select "Add User-Defined Setting" from the dropdown menu
Replace the left side text "New Setting" with GCC_C_LANGUAGE_STANDARD
add the text "c99" to the right side of the line
clean your target & rebuild!