Include of non-modular header inside framework module

Dev picture Dev · Jan 5, 2015 · Viewed 102.1k times · Source

I am using Xcode 6,

1) Firstly I am creating a dynamic library (CoreLibrary). This library contain RequestPoster.h file.

2) Then I create a Cocoa Touch Framework and added this dynamic library (CoreLibrary).

3) Then this framework is add on my project and it gives error in RequestPoster.h file (CoreLibrary).

Error : Include of non-modular header inside framework module class :

ifaddrs.h, arpa/inet.h, sys/types.h>

These file not found in the project.

Answer

bcattle picture bcattle · Feb 17, 2015

Try going Build Settings under "Target" and set "Allow Non-modular Includes in Framework Modules" to YES.

The real answer is that the location of the imports needs to be changed by the library owner. Those files ifaddrs.h, arpa/inet.h, sys/types.h are getting imported in a .h file in a framework, which Xcode doesn't like. The library maintainer should move them to a .m file. See for example this issue on GitHub, where AFNetworking fixed the same problem: https://github.com/AFNetworking/AFNetworking/issues/2205