iOS工程里添加C文件造成的编译错误

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk/usr/include/objc/module.modulemap:8:10: Module 'ObjectiveC.NSObject' requires feature 'objc'

错误:expected identifier or’(’ 

unknown type name‘nsstring’ 

declaration of ‘protocol’must be imported from module’objectiveC.runtime’before it is required

原来在xcode里新建的pch文件少了: 

#ifdef __OBJC__ 

#endif 

这一段代码,把这段加上去,并把在pch里import的头文件放到 

#ifdef OBJC里,clean之后重新编译,大功告成!

猜你喜欢

转载自blog.csdn.net/haifangnihao/article/details/87695326
今日推荐