Undefined symbols for architecture i386: _htmlReadMemory

SOAPEngine is an iOS SOAP client library, the trial version provides a .framework file for user.

I added it via Project->Targets->General->Linked Frameworks and Libraries, then include its header file:

But when compiling the program, I got following error message:

Undefined symbols for architecture i386:
“_htmlReadMemory”, referenced from:
_PerformHTMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
“_xmlFreeDoc”, referenced from:
_PerformHTMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
_PerformXMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
“_xmlReadMemory”, referenced from:
_PerformXMLXPathQuery in SOAPEngineTrial(XPathQuery.o)
“_xmlXPathEvalExpression”, referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
“_xmlXPathFreeContext”, referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
“_xmlXPathFreeObject”, referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
“_xmlXPathNewContext”, referenced from:
_PerformXPathQuery in SOAPEngineTrial(XPathQuery.o)
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

 

Actually libxml2 is needed for SOAPEngine, so we need add “libxml2.dylib” file to “Linked Frameworks and Libraries”. After adding this library, the error disappeared.