Adding a third-party class library caused by undefined symbols for architecture i386: compilation error

Source: Internet
Author: User

 

Directory (?) [-]

    1. There's another httpstackoverflowcomquestions6610709undefined-symbols-for-architecture-i386.
    2. Undefined symbols for architecture i386 _objc_class__skpsmtpmessage referenced from error
1.原因: 如果是源码编译的话,一般就只某些头文件没有添加到src编译里面。但是对于添加库编译,一般是库的编译路径设置不正确(比如arm的版本、模拟器或者真机的不同版本库引用错误或者重复引用一起编译器不知道如何选择)、或者库没有添加到lib path中。
2.解决:2.1 For the Library Reference of the external library real machine and simulator, you can refer to http://blog.csdn.net/forlong401/article/details/9304883
2.2 如果这些库是系统自带库,那就是在Build Phases的link binary with libraries里面添加即可。

3.参考(虽然很多写的都不太正确,但是可以参考一下):
http://my.csdn.net/kaixinnow2008/code/detail/4209

解决方法: 先点击方案(左边列表,点击方案的图示) 选择target 选择页签Build Phases Compile Source 如果没展开的话先展开 向下找加号,点击加号,将这个target需要的.m档案的头文件都加入吧 (如果只有一个 就把左右的.h档案都加入) 这样就应该可以了
http://blog.csdn.net/itianyi/article/details/8499504

1, how to troubleshoot Xcode errors: Undefined symbols for architecture i386 error

There is undefined symbols for architecture i386 This error is usually you use the simulator as the target, but when compiling the relevant library files can not be found, the need to do is to add the location of the library files in the database search path. For other reasons, refer to the following URL: http://stackoverflow.com/questions/6984368/ Undefined-symbols-for-architecture-i386-objc-class-skpsmtpmessage-refere there is another one: http://stackoverflow.com/ Questions/6610709/undefined-symbols-for-architecture-i386

2,undefined Symbols for Architecture i386: _objc_class_$_skpsmtpmessage ", referenced From:error answer: Can get this type O F 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, why the link with the Lib add libxml2.dylb after the reference can not <libxml/tree.h> always find the header file?

Answer: 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 Flag S ".

Adding a third-party class library caused by undefined symbols for architecture i386: compilation error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.