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

[xml] problem of compilation the library Libxml2



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�p�tion 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�tion de la m�ire
��� xmlFreeDoc(doc);

��� return EXIT_SUCCESS;
}


After the compilation, I have the following message errors:

1>------ D�t de la g�ration�: Projet�: passage, Configuration�: Debug Win32 ------
1>�ition des liens en cours...
1>main.obj : error LNK2019: symbole externe non r�lu _xmlFreeDoc r�renc�ans la fonction _main
1>main.obj : error LNK2019: symbole externe non r�lu _xmlDocGetRootElement r�renc�ans la fonction _main
1>main.obj : error LNK2019: symbole externe non r�lu _xmlParseFile r�renc�ans la fonction _main
1>C:\ChGaLib\passage\Debug\passage.exe : fatal error LNK1120: 3 externes non r�lus
1>Le journal de g�ration a � enregistr� l'emplacement "file://c:\ChGaLib\passage\passage\Debug\BuildLog.htm"
1>passage - 4 erreur(s), 0 avertissement(s)
========== G�ration�: 0 a r�si, 1 a �ou�0 mis �our, 0 a � ignor�=========



I will be very happy for your help.

Best regards.

Asma Bouali



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