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é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.
Ответы
Hello,
Error LNK2019 indicates that undefined external symbol (symbol) was found in your code. In your case, most likely, there are some library cannot be found when compiling the project. Please check that the each library you used is included in the Library Files.
More information
http://msdn.microsoft.com/en-us/library/799kze2z.aspx
http://support.microsoft.com/kb/309801
Since this forum is for Visual SourceSafe, question about VC++, I recommend you post on VC++ forum for better response.
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread
By the way, please also translate the error message to English when posting on VC++ forum.
Thanks,
Rong-Chun Zhang
Please mark the replies as answers if they help and unmark if they don't.
Welcome to the All-In-One Code Framework, a sample code project owned by the MSDN Forum Support team!- Помечено в качестве ответаRong-Chun ZhangMSFT, Модератор3 июля 2009 г. 9:17
Все ответы
Hello,
Error LNK2019 indicates that undefined external symbol (symbol) was found in your code. In your case, most likely, there are some library cannot be found when compiling the project. Please check that the each library you used is included in the Library Files.
More information
http://msdn.microsoft.com/en-us/library/799kze2z.aspx
http://support.microsoft.com/kb/309801
Since this forum is for Visual SourceSafe, question about VC++, I recommend you post on VC++ forum for better response.
http://social.msdn.microsoft.com/Forums/en-US/vcgeneral/thread
By the way, please also translate the error message to English when posting on VC++ forum.
Thanks,
Rong-Chun Zhang
Please mark the replies as answers if they help and unmark if they don't.
Welcome to the All-In-One Code Framework, a sample code project owned by the MSDN Forum Support team!- Помечено в качестве ответаRong-Chun ZhangMSFT, Модератор3 июля 2009 г. 9:17

