今天打开一个之前写的工程,突然报了<libxml/tree.h> file not found 的错误,其实这类错误很容易解决,在 Build Settings -> Header Search Paths里设置正确就没问题了,于是查<libxml/tree.h>的基准路径在哪里,经检查,路径为:

/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include/libxml2

而之前写的路径为

/usr/include/libxml2

这就是问题所在,修改之后,编译,结果还是报同样的错误,fuck!纠结了好久,一度认为Xcode难道是出bug了,正当我心灰意冷之时,在stackoverflow上找到了答案,看最后一句:

Just in case anyone is in the same situation I was: remember to add the search path also to the test target.

原来对应的Xcode自动生成的Test Target的buildingSettings里还没有改过来,搞定!


change2hao
96 声望4 粉丝

引用和评论

0 条评论