XCODE:<IOS>OTHER linker flags

Source: Internet
Author: User

When importing the XMPP third library in the project, a link error occurred with the following error:
Undefined Symbols for Architecture i386:
"_iconv", referenced from:
_mem_cd_iconv in Libidn.a (STRICONV.O)
_str_cd_iconv in Libidn.a (STRICONV.O)
(Maybe you meant: _str_iconv, _str_cd_iconv, _mem_cd_iconv)
"_iconv_close", referenced from:
_str_iconv in Libidn.a (STRICONV.O)
"_iconv_open", referenced from:
_str_iconv in Libidn.a (STRICONV.O)
Ld:symbol (s) not found for architecture i386
Clang:error:linker command failed with exit code 1 (use-v to see invocation)


At first I thought it was a path problem and the library file was not well-directed. But repeated checks found that was not the case. Libidn.a This static library is already in link Binary with libraries. On the internet for a long time of information, and finally at noon when thought of the other linker flags This parameter setting, so found that this parameter setting is-all-load, delete it, then run no error, problem solving. Some information about this parameter was checked in the afternoon.



Include a static library when you need to add a value to the other linker flags of target:-objc,-all_load,-force_load for 64-bit and iphone OS applications, the solution is to use-all_load or-force_ Load -all_load forces the linker to load all object files, even those without the OC code, from all the documents it can see. The-force_load applies to the xcode3.2+ version, which allows finer to get control of document loading. Each-force_load operation must follow a document path, and each object file in the document will be loaded. -all_load will load all members of the static library file, and-OBJC will load all members of a class or category in a static library file,-force_load (the path to the package) is all members of the static library file that will load the specified path. For example, when linking an OC static library that contains a category, you will get a runtime exception: "Selector not recognized". You need to set the other Linker flags to a value of-OBJC OK

XCODE:<IOS>OTHER linker flags

Related Article

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.