Clang: ‘Could not find clang-cc line’ error
This is a problem I ran into when trying to use the clang static analyzer with my iPhone app. I kept getting the error ‘could not find clang-cc line’ and Google didn’t provide much information about it. I had to follow a number of steps to get it to work properly:
- First, I had to change the Base SDK in the project settings to match my current target build. I had a mismatch here that caused clang to give me the above error. I ended up using the debug simulator build.
- Next, I turned off code signing in the project settings, but I’m not sure if this is strictly necessary
- Then, I cleaned the build with xcodebuild -configuration Debug clean
- Finally, I forced it to analyze the debug build by running scan-build xcodebuild -configuration Debug
Once I got it all worked out, it was awesome! It found two serious bugs and a couple other minor ones. It totally was worth the headache of getting it working!
July 2nd, 2009 at 3:05 pm
[...] Clang: ‘Could not find clang-cc line’ error « The Cram Fighter Blog Once I got it all worked out, it was awesome! It found two serious bugs and a couple other minor ones. It totally was worth the headache of getting it working! (tags: clang-llvm static-analysis quality bugs) [...]
July 7th, 2009 at 4:42 am
[...] solution for this was at cramfighter.com. Basically I need to change some projects [...]
August 8th, 2009 at 3:16 am
Thanks for posting these tips — they definitely helped me. Turning off code signing is definitely not necessary. Also, it helped for me to specify the exact configuration and sdk I wanted, e.g.:
xcodebuild -sdk iphonesimulator3.0 -configuration Debug
August 8th, 2009 at 2:27 pm
Awesome, thanks for clarifying.