libxml2 errors. no such file or directory

孤人 提交于 2019-12-04 14:50:19

Header Search Paths: $(SDKROOT)/usr/include/libxml2

Other Linker Flags: -lxml2

Add libxml2.2.dylib in the Build Phases tab

If you did it exactly like this there may be an issue with your XCode, because that's all you need for XCode 4, 4.2 (I just tried just in case I was missing something), and if I recall correctly also for XCode 3.

It seems that what solved this problem for me was making sure that XCode 4.0.2 is installed in the default Developer directory (hat tip to Melvin!)

I only needed to do the following:

  • Uninstall XCode 3.x from the default Developer folder
  • Uninstall XCode 4.0.2 from a custom folder location (it was installed at "Developer 4.0.2")
  • Restart
  • Install XCode 4.0.2 into the default Developer folder

I'm not certain that the restart was necessary but I threw it in for good measure.

My experience differs from Melvin's in that:

  • I did not need to uninstall all of my XCode 3 SDKs (I kept XCode 3.2.5 in my "Developer 3.2.5" folder)
  • I did not need to reinstall Mac OS X (I was already updated to the current version - 10.6.8 as of this writing)

Try using this instead:

"$(SDK_DIR)"/usr/include/libxml2

Or try setting the individual target settings instead of the project-wide settings.. You can set header search paths both project-wide and for individual targets. Try doing it for the target instead if you haven't tried it. (Project -> Edit Active Target). Also make sure you set it for the current build configuration (or for all configurations)

Ok guys, I solved this problem already partly thanks to Jano as well.

So this is what I did.

  1. Uninstalled all existing Xcode 3 SDKs
  2. Reinstall MAC OS X
  3. Update MAC OS X to 10.6.7
  4. Install Xcode 4 in the default folder (Developer)

And it is solved! The weird experiment I tried again was to install Xcode 3.2.6 only to find the same 16 errors on the libxml2.2.dylib. So Xcode 4 works, Xcode 3 failed. Therefore, time to get use to Xcode 4!

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!