0

I am creating a static library which will later be used in multiple apps.

As in an Xcode project, if we have to import a specific file in every other file of the project, we import that file in prefix.pch. I have a similar requirement, to include a file in all other files of my static library.

So, is it possible to have a Precompiled header(prefix.pch) in a static library?

OR

Is there any way by which I can include a specific .h file in all other files of my static library?

Sagar D
  • 2,588
  • 1
  • 18
  • 31
  • Pre-compiled files are part of the project, not the deliverable. So no, you cannot. – trojanfoe May 12 '16 at 13:58
  • Possible duplicate of: [1](http://stackoverflow.com/q/5465836/2415822) [2](http://stackoverflow.com/questions/22400925/using-a-pch-file-of-static-library-in-other-project) [3](http://stackoverflow.com/questions/30521176/clang-linking-a-static-library-with-a-pch-file-causes-error-with-static-di)? – JAL May 12 '16 at 13:59
  • @trojanfoe any other technique you know by which i can include a specific file in all other files ? – Sagar D May 12 '16 at 15:29
  • What's wrong with a normal header file? – trojanfoe May 12 '16 at 16:17
  • @trojanfoe That's the thing I want to do, include a NORMAL header file in every other file.. I want to avoid the manual import statements in every file.. – Sagar D May 12 '16 at 16:45
  • You can have a "master" header file that includes all other headers. This is the normal pattern and what users of your library would expect. – trojanfoe May 12 '16 at 17:07

0 Answers0