Search code examples
objective-clinuxoclint

'objc/objc.h' file not found when trying to compile a objective-c program.What should I do?


If i use :

oclint test2.m -- -x objective-c -arch armv7 -std=gnu99 -fobjc-arc -O0 -isysroot /Developer/SDKs/iPhoneOS6.0.sdk -g -I./Pods/Headers -c

or:

oclint test2.m -- -c

It will show a Compiler Error:

/usr/include/Foundation/Foundation.h:31:9: 'objc/objc.h' file not found

.


Solution

  • That you have /usr/include/Foundation/Foundation.h:31:9: 'objc/objc.h' file not found and you have -isysroot /Developer/SDKs/iPhoneOS6.0.sdk indicates that there is something weird about either that invocation line or in your install.

    Start by building a standard dead simple Xcode project (you are on OS X w/Xcode, right?) and copy the compilation line out of the build, then modify accordingly.

    Aha! Missed the Linux tag, which provides even more context! So... yeah... non-standard environment means you're gonna have to futz with the install and/or invocation until it works.