I have an XCode
project with objective-C
files. If I add a new (empty) C file
and try to build, I get a large number of errors right away while building a precompiled header, in ProcessPCH step. The errors are "fatal error: Could not build module 'Foundation'", and things in Foundation.h
not being found. Remove the C file and it builds again. What is going on, and how to fix it?
(XCode 5.0, OSX 10.8.4)
EDIT I have tried Clean and Clean build folder, no effect.
EDIT Setting Precompile prefix header = No
results in a bunch of syntax errors instead, in stuff like NSObject.h
(and other Foundation framework header).
EDIT User Cy-4AH figured it out: there needs to be #ifdef __OBJC__
around the whole pch file.
Surround #import
's with preprocessor directive #ifdef __OBJC__ #endif
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With