LibXML2.dylib and Xcode4

2019-01-13 14:28发布

I just downloaded Xcode 4 and I cant seem to run my application as the MGTwitter... classes are complaining of a non inclusion error of LibXML2. I have imported it into the frameworks folder, and I have put the following in the header bit in the build settings

$(SDKROOT)/usr/include/libxml2

But I am still getting 65 errors.

Any ideas how to fix this?

11条回答
闹够了就滚
2楼-- · 2019-01-13 14:49

You need to add also the framework libxml2.dylib

查看更多
Explosion°爆炸
3楼-- · 2019-01-13 14:54

You need to add "$(SDK_DIR)/usr/include/libxml2" in "Release" Category rather then in "Debug" Category under "Header Search Path" if you are putting it into a device.

查看更多
贼婆χ
4楼-- · 2019-01-13 14:55
  1. Get info on the target and go to the build tab
  2. Add -lxml2 to the Other Linker Flags property
  3. Add -I/usr/include/libxml2 to the Other C Flags property
查看更多
贼婆χ
5楼-- · 2019-01-13 14:56

I think the selected answer is better. However this one worked for me: enter image description here

I just drag and drop.

I do not know why it works. It's how the old programmer do it. I suppose there should be a framework we can include and that should be fine?

Also other computers may not have file libxml2.dylib in that exact spot and things may go wrong.

查看更多
6楼-- · 2019-01-13 14:57

Please try this one:

${SDK_DIR}/usr/include/libxml2
查看更多
登录 后发表回答