I am looking for an easy to use html parser library. Currently I am trying to setup libxml2 but am running into frustrating problems. The IDE I am using is Pelles C, I took the windows files for libxml2 and put them in the appropriate folders (headers in the correct header area, binaries in bin, libs in libraries etc.) but still whenever I try to compile a program the compiler just tells me that every libxml2 function I call is undefined. For example:
Linker Flags:
-subsystem:console -machine:amd64 kernel32.lib advapi32.lib delayimp64.lib Ws2_32.lib libxml2.lib
Code:
static void print_element_names(xmlNode * a_node)
{
xmlNode *cur_node = NULL;
for(cur_node = a_node; cur_node; cur_node = cur_node->next)
{
if (cur_node->type == XML_ELEMENT_NODE)
{
printf("node type: Element, name: %s\n", cur_node->name);
}
print_element_names(cur_node->children);
}
}
int main(void)
{
xmlDoc *doc = NULL;
xmlNode *root_element = NULL;
LIBXML_TEST_VERSION
doc = xmlReadFile("XMLFILE"/*XML_FILE PUT HERE*/, NULL, 0);
if (doc != NULL) printf("error: could not parse file");
root_element = xmlDocGetRootElement(doc);
print_element_names(root_element);
xmlFreeDoc(doc);
xmlCleanupParser();
return 0;
}
just gives me the following errors when trying to compile:
POLINK: error: Unresolved external symbol 'xmlCheckVersion'.
POLINK: error: Unresolved external symbol 'xmlReadFile'.
POLINK: error: Unresolved external symbol 'xmlDocGetRootElement'.
POLINK: error: Unresolved external symbol 'xmlFreeDoc'.
POLINK: error: Unresolved external symbol 'xmlCleanupParser'.
POLINK: fatal error: 5 unresolved external(s).
this whole situation is driving me insane, if anybody could help me resolve this issue or perhaps suggest an easier to setup html parser I would immensely appreciate it.