Ok Peeps. I'm struggling with the basics here.
the file structure is:
./Makefile
./main.c
./libxml2-2.0.0/parser.c
./libxml2-2.0.0/parser.h
./libxml2-2.0.0/parser.h:
...
xmlDocPtr xmlParseDoc (xmlChar *cur);
...
./libxml2-2.0.0/parser.c:
...
xmlDocPtr
xmlParseDoc(xmlChar *cur) {
return(xmlSAXParseDoc(NULL, cur, 0));
}
...
part of my code is:
main.c:
#include <curl/curl.h>
#include <parser.h>
#include <tree.h>
struct string {
char *ptr;
size_t len;
};
void extractXML(struct string *s)
{
xmlDocPtr doc;
doc = xmlParseDoc( (xmlChar *) s->ptr);
}
int main(void){..}
Makefile:
CC=gcc
LIBS = -lcurl
MyProgram: main.c
$(CC) $? $(LIBS) -Ilibxml2-2.0.0 -o $@
ERROR:
In function `extractXML':
main.c:(.text+0xbf): undefined reference to `xmlParseDoc'
So the library is included, other libxml and parser.h elements are being used fine, but xmlParseDoc
I can't use. How to solve it?