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