开发者

iPhone static library creation

I have created a static library LibA.a which includes some codes and another static library LibB.a. When I use this static library LibA.a in a new project I get many errors like these:

File1.h no such file or directory.

This file File1.h and others showing error are present in LibB.a.

Edit 1: I am using XCode 4.0.1

Edit 2: Now while creating my static library, I have made the header file public whose methods the user can use in their project. My static library references another static library named XWidget.a. I have added it into my static library's "Link Binary with Libraries" and also in the direct dependency. Then created my static library. Now I am testing my library in a demo project. In开发者_运维问答 Header Search Paths of demo project I have added the path of my static library's public header file.When I run it, the header files which are present in the inner static library XWidget.a are not found. Giving errors like FileA.h: no such file or directory. Should I somehow provide the path of inner static library (XWidget.a) also? If yes then how? Or what else am I missing?


You need to include the header files in the project where you want to interface with the library.


Click on the big project button in Xcode's file management tab on the sidebar, select your target, click Build Phases, and pull down the drop down menu titled "Compile Sources". Then make sure all the necessary .m, not .h, files are there.

I've run into this problem a couple times myself, I hope this helps you!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜