views:

131

answers:

2

The "Build and analyze" option doesn't seem to work for .cpp and .mm files. I tried "clang --analyze" on individual files without any standard #includes and it works well. However I'm not able to run it on my Xcode project. I couldn't figure out a way to make clang find the standard #includes like even UIKit.h. Any clues?

+1  A: 

clang's C++ support is not complete yet clang web site

Apple's version is more explicit clang man page

Clang currently does not have C++ support

Mark
You're right, but it is possible to run the analyzer on any file you like. And I am happy with incomplete functionality too. Also, my question was how to make clang find the #included frameworks.
Plumenator
Did you try on plain C or Obj C files I think on compiles at least XCode switches to plain gcc and it might do that for Static analysis as well
Mark
+1  A: 

One way is to create symlinks to the Frameworks present in /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.1.2.sdk/System/Library/Frameworks/XXX.framework/Headers and point clang to the symlinks using the -I option.

Plumenator