Задайте вопросЗадайте вопрос
 

Отвеченоproblem of compilation the library Libxml2

  • 27 июня 2009 г. 7:28chabnasri Медали пользователяМедали пользователяМедали пользователяМедали пользователяМедали пользователя
     
    Hi,

    - I extract all the seven archive libxml2-2.7.3.win32, iconv-1.9.2.win32, zlib-1.2.3.win32, libxmlsec-1.2.11+.win32, libxslt-1.1.24.win32, xsldbg-3.1.7.win32 et openssl-0.9.8a.win32.

    - I put the three directory include , bin et lib of each seven archives under the three following directory include , bin et lib of Visual Stusio

    C:\Program Files\Microsoft Visual Studio 9.0\VC\include\libxml
    C:\Program Files\Microsoft Visual Studio 9.0\VC\bin
    C:\Program Files\Microsoft Visual Studio 9.0\VC\lib

    - I added in the PATH ofvariable system:
    C:\Program Files\Microsoft Visual Studio 9.0\VC\bin

    - I wrote in my program C a simple example giving in the site of LIBXML2 :

    #include <stdio.h>
    #include <stdlib.h>
    #include <libxml/parser.h>
     
    int main() {
        xmlDocPtr doc;
        xmlNodePtr racine;

        // Ouverture du fichier XML
        doc = xmlParseFile("catalogue.xml");
        if (doc == NULL) {
            fprintf(stderr, "Document XML invalide\n");
            return EXIT_FAILURE;
        }
        // Récupération de la racine
        racine = xmlDocGetRootElement(doc);
        if (racine == NULL) {
            fprintf(stderr, "Document XML vierge\n");
            xmlFreeDoc(doc);
            return EXIT_FAILURE;
        }
        printf("La racine du document est : %s\n", racine->name);
        // Libération de la mémoire
        xmlFreeDoc(doc);

        return EXIT_SUCCESS;
    }

    After the compilation, I have the following message errors:

    1>------ Début de la génération : Projet : passage, Configuration : Debug Win32 ------
    1>Édition des liens en cours...
    1>main.obj : error LNK2019: symbole externe non résolu _xmlFreeDoc référencé dans la fonction _main
    1>main.obj : error LNK2019: symbole externe non résolu _xmlDocGetRootElement référencé dans la fonction _main
    1>main.obj : error LNK2019: symbole externe non résolu _xmlParseFile référencé dans la fonction _main
    1>C:\ChGaLib\passage\Debug\passage.exe : fatal error LNK1120: 3 externes non résolus
    1>Le journal de génération a été enregistré à l'emplacement "file://c:\ChGaLib\passage\passage\Debug\BuildLog.htm"
    1>passage - 4 erreur(s), 0 avertissement(s)
    ========== Génération : 0 a réussi, 1 a échoué, 0 mis à jour, 0 a été ignoré ==========


    I will be very happy for your help.

    Best regards.


Ответы

Все ответы