简体   繁体   中英

Libxml in a library for ios

I have created a cocoa touch static library that contains functionality that I want to include in several apps. This library is linked to libxml and I have the header search path /usr/include/libxml2. The library builds correctly.

I include this library in another xcode project as a reference (by dragging the library xcodeproj file into my app xcode project. I also setup the target to have the library as a direct dependency, setup the header search path to include /usr/include/libxml2, and add libxml2.dylib in the frameworks.

The problem is, when I try to build the project is has a build error:

Libxml/tree.h: No such file or directory.

I initially had this problem trying to build the library and solved it by adding the header search path and framework into the project for libxml2.

Incidentally, i have another app that uses the library but does not use libxml, it builds and runs correctly.

So the problem seems to be using libxml in both the app and a linked library.

Anybody any ideas?

Yours hopefully, Neil.

You probably need to add the include path /usr/include/libxml2 to both the target and the project.

To add it to the target, right click on the target and select Get Info.
To add it to the project, go to the Project menu > Edit Project Settings.

In both cases, make sure you've selected Configuration: "All Configurations".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM