Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
562 views
in Technique[技术] by (71.8m points)

objective c - Adding libxml2 in XCode

I have added libxml2 to my Xcode 4 project following this guide.

But it's not working. Xcode gives me error saying it no such libxml2 directory. What am I doing wrong? Here's the screenshots of the target settings of my project: enter image description here

enter image description here

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
  1. add ${SDKROOT}/usr/include/libxml2 to "Header Search Paths" instead of "User Header Search Paths" under yourtarget -> Build Settings -> Search Paths
  2. link with libxml2.dylib in yourtarget -> Build Phases -> Link Binary With Libraries
  3. include libxml2 headers with, for instance, #include <libxml/HTMLparser.h> and you're off

for better explanation see to this answer https://stackoverflow.com/a/3429301/149663


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...