报错: Undefined symbols for architecture i386 error

1,如何解决XCODE中错误: Undefined symbols for architecture i386 error

出现Undefined symbols for architecture i386这种错误一般是你用模拟器作为目标,但编译的时候找不到相关的库文件,需要做的就是把库文件所在的位置添加到library search path中。

其它原因可参考下面网址:http://stackoverflow.com/questions/6984368/undefined-symbols-for-architecture-i386-objc-class-skpsmtpmessage-refere    

还有另外一个:http://stackoverflow.com/questions/6610709/undefined-symbols-for-architecture-i386


2,Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error

答案:You can get this type of error if your class' .m file is not listed under the "Compile Sources" step of the "Build Phases" tab of your target. Normally Xcode does this for you, but sometimes it loses the plot and you need to add the .m file manually.

    3,请问为什么在link with lib 种添加  libxml2.dylb  后  引用不了  老是找不到头文件?

答案:XCODE ,  Project -> Edit Project Settings -> Build Settings

You need to add “/usr/include/libxml2″ to the “Header Search Paths” and you need to add “-lxml2″ to the “Other Linker Flags”.

你可能感兴趣的:(IOS报错)