如何在IOS上的另一个静态库中包含静态库

时间:2023-01-13 16:04:18

I have a static library let's call it third_party.a , I have integrated this in my util_library.a by adding it to Link binary with library option in Build Phase on Xocde. Now when I integrate util_library in my testingApp , it doesn't build as it cannot file the headers of third_party library . Is there a way where I don't have to include the headers of third_party in my testingApp and build it.

我有一个静态库让我们称之为third_party.a,我已经将它集成在我的util_library.a中,通过在Xocde上的Build Phase中将它添加到Link binary with library选项。现在,当我在我的testingApp中集成util_library时,它没有构建,因为它无法存档third_party库的头文件。有没有办法我不必在我的testingApp中包含third_party的标头并构建它。

1 个解决方案

#1


0  

If it can't build because of headers, its because you have included a header in a public header file. You need to refactor your code so that the third party header file is only included in .cpp/.c files, or included in header files that aren't included by the user's application.

如果由于标题而无法构建,则因为您在公共头文件中包含了标头。您需要重构代码,以便第三方头文件仅包含在.cpp / .c文件中,或包含在用户应用程序未包含的头文件中。

#1


0  

If it can't build because of headers, its because you have included a header in a public header file. You need to refactor your code so that the third party header file is only included in .cpp/.c files, or included in header files that aren't included by the user's application.

如果由于标题而无法构建,则因为您在公共头文件中包含了标头。您需要重构代码,以便第三方头文件仅包含在.cpp / .c文件中,或包含在用户应用程序未包含的头文件中。