Re: [xml] libxml2 linker errors in Visual Studio 2010



Thanks Bjoern, but I still can't figure out how to link it properly.

I'm just trying to compile the example program:

#include <libxml/xmlreader.h>

void processNode(xmlTextReaderPtr reader) {
    /* handling of a node in the tree */
}

int streamFile(char *filename) {
    xmlTextReaderPtr reader;
    int ret;

    reader = xmlNewTextReaderFilename(filename);
    if (reader != NULL) {
        ret = xmlTextReaderRead(reader);
        while (ret == 1) {
            processNode(reader);
            ret = xmlTextReaderRead(reader);
        }
        xmlFreeTextReader(reader);
        if (ret != 0) {
            printf("%s : failed to parse\n", filename);
        }
    } else {
        printf("Unable to open %s\n", filename);
    }
}

My linker additional dependencies are:
kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;C:\libraries\LibXML2\lib\iconv.lib;C:\libraries\LibXML2\lib\iconv_a.lib;C:\libraries\LibXML2\lib\libxml2.lib;C:\libraries\LibXML2\lib\libxml2_a.lib;C:\libraries\LibXML2\lib\libxml2_a_dll.lib;%(AdditionalDependencies)

Please tell me how to get this working.

Thanks for all suggestions,

Alec Taylor

On Thu, Oct 13, 2011 at 11:13 AM, Bjoern Hoehrmann <derhoermi gmx net> wrote:
* Alec Taylor wrote:
1>LINK : fatal error LNK1561: entry point must be defined

<http://msdn.microsoft.com/en-us/library/ky737ya4(v=VS.100).aspx>:

 The linker did not find an entry point. You may have intended to link
 as a DLL, in which case you should link with the /DLL option. You may
 have also forgotten to specify the name of the entry point; link with
 the /ENTRY option.

 Otherwise, you should include a main, wmain, WinMain, or wMain
 function in your code.

That seems pretty clear.
--
Björn Höhrmann · mailto:bjoern hoehrmann de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/




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