Home Ask Login Register

Developers Planet

Your answer is one click away!

azimov February 2016

Header file not found in Xcode 7

I'm creating a framework which embed some C libraries. The C libraries code is exposed to Swift using a .modulemap file. In the Build Settings of the target, under Swift Compiler - Search Paths section I set path to the .modulemap file in Import Paths row. Also under Search Paths section, paths for libraries and headers are set, in Library Search Paths and Header Search Paths rows respectively. After adding framework to the app's project and trying to build app, it fails with error pjsip.h file not found.

  • Values of Header Search Paths:

enter image description here

  • Structure of headers folders

enter image description here

The import process starts with highlighted blue file pjsua.h which then imports other headers, those marked with red rectangles.

  • The complete list of imported headers in pjsua.h

enter image description here

You can see that imported headers are not living in same folder as pjsua.h as should be for successful import, but isn't this the job of the Header Search Paths to find the headers ? I don't want to mess the structure of the headers folders, cause it's a third party lib and each time it will be updated each time this 'magic' must be done. The include path is defined in Other C Flags row which is same as settings Header Search Paths. I'm not sure what I've missed.



azimov February 2016

Solution is simple but ugly. Set Header Search Paths and Search Paths for the main project too. That's definitely not the best way to add a framework to a project because it exposes details about framework but it's the only way to fix the problem.

Post Status

Asked in February 2016
Viewed 3,273 times
Voted 6
Answered 1 times


Leave an answer

Quote of the day: live life