Re: [xml] libxml2-2.5.7 on vs.net



Okey, I don't think building libxml is my thing to do really, if I'm
having trouble with more basic things =)

What I do is in a cpp file I implement:

#include <libxml/parser.h>

and then in a function I do:

void foobar() {
        string xmltext = [some kind of input, read an xml-file or get it
from a socket or something like that];
        xmlDocPtr pdoc = xmlParseMemory(xmltext.c_str(),
xmltext.size());
        xmlNodePtr node = xmlDocGetRootElement(pdoc);
        xmlAttrPtr attr;
        // here comes some tree parsing....
}

and in vs.net -> Project -> Properties -> Linker -> Input -> Additional
dependencies, I add libxml2.lib (and i've included its path in vs.net's
search path for libraries). I have other libs there such as kernel32.lib
and user32.lib etc...

Ain't doing anything else than that. Nothing. (okey, added the include
directory offcourse).

/Gustaf

PS.
Sorry, haven't had any coffey yet, that'll be for the evening :-)
DS.





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]