1

I watch this video to know how to create a static library, I just watched until the 4:05 minute video (which have already been enough to learn how to create a static library).

But I learned that there's another way to import a static library for the project called subproject, for this I open my iphone project and add my library project (MuitosAlertas.xcodeproj), Then I added two references to my library inside the tab Target Dependencies and Link Binary with libraries as you can see below:

enter image description here

When I compile and run, Xcode give me the problem

Lexical or preprocessor issue 'MuitosAlertas.h' file not found

I try to put inside Other linker flags the code -ObjC but without results, how can I solve this problem

LettersBa
  • 747
  • 1
  • 8
  • 27

2 Answers2

1

You must add Header Search Path to your target. In build setting search "Header Search Path" and add relative link to your static library project. How to add relative path read more here

You may need to search path with recursive option.

Community
  • 1
  • 1
larva
  • 4,687
  • 1
  • 24
  • 44
0

Once you have created your Library then make a build from the target added separately for the Universal support and then by right clicking on to the .a file from bundle navigate to folder and look for Universal and copy Include folder and your StaticLibrary.a file, then where you want to use it paste in that project and add reference to it and in bundle setting you need to set the HeaderSearchPath of the library where it is kept and the OtherLinkerFlag to -ObjC. Then import the headers of your library and use your methods.