C / XML

Fermé
safir - 22 sept. 2003 à 10:48
 sheep - 11 avril 2007 à 15:37
bonjour,
J'essaye de lancer un petit programme en c qui appelle des fonction xml (je suis sous Visual studio.net).
J'ai crée un projet comportant les librairies xml et ça se compile sans problème.
J'ai crée un autre porjet "test_xml" qui contient un "gjobread.c" qui appelle des fonctions déclarées dans les librairaies xml. Ca se compile sans problème. Mais quand j'essaye de générer un exécutable tes_xml.exe , j'ai un problème de link avec les .obj.
Voilà le message que j'ai eu :
gjobread.obj : error LNK2019: symbole externe non résolu _xmlNodeListGetString référencé dans la fonction _parsePerson
gjobread.obj : error LNK2019: symbole externe non résolu _xmlGetProp référencé dans la fonction _parseJob
gjobread.obj : error LNK2019: symbole externe non résolu _xmlDocDump référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlIsBlankNode référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlSearchNsByHref référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlFreeDoc référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlDocGetRootElement référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlParseFile référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlKeepBlanksDefault référencé dans la fonction _main
gjobread.obj : error LNK2019: symbole externe non résolu _xmlCheckVersion référencé dans la fonction _main
LIBCMTD.lib(wincrt0.obj) : error LNK2019: symbole externe non résolu _WinMain@16 référencé dans la fonction _WinMainCRTStartup
Debug/xml_test.exe : fatal error LNK1120: 11 externes non résolus

Le journal de génération a été enregistré à l'emplacement "file://d:\xml_test\Debug\BuildLog.htm"
xml_test - 12 erreur(s), 0 avertissement(s)

Avez vous une idée ?
Merci d'avance
A voir également:

6 réponses

Lord Woden Messages postés 89 Date d'inscription vendredi 3 janvier 2003 Statut Membre Dernière intervention 19 janvier 2006 21
22 sept. 2003 à 13:56
Salut,

Apparemment tu utilises la librairie free pour gnome "libxml2". Quand tu dis que tu as créé un projet "comportant les librairies xml", est-ce que tu es certain d'avoir inclus dans les propriétés de ton projet un lien dans les "Enrées" de l'"Editeur de liens" vers le fichier ".lib" de ta librairie XML et pas juste inclus les fichiers ".h" Par ce que là, c'est ce que ca a l'air dans ton log. De plus, j'espère que tu utilises bien la v2 de la libxml sinon tu va avoir des problèmes...

@+ Lord Woden ;o)
0
bonjour,
C'est toujours la même question mais j'ai changé juste le titre pour qu'il soit parlant.


J'essaye de lancer un petit programme en C qui appelle des fonction xml (je suis sous Visual studio.net).
J'ai crée un projet comportant les librairies xml et ça se compile sans problème.
J'ai crée un autre porjet "test_xml" qui contient un "gjobread.c" qui appelle des fonctions déclarées dans les librairaies xml. Ca se compile sans problème. Mais quand j'essaye de générer un exécutable tes_xml.exe , j'ai un problème de link avec les .obj.
Voilà le message que j'ai eu :
gjobread.obj : error LNK2019: symbole externe non résolu _xmlNodeListGetString référencé dans la fonction _parsePerson
gjobread.obj : error LNK2019: symbole externe non résolu _xmlGetProp référencé dans la fonction _parseJob
gjobread.obj : error LNK2019: symbole externe non résolu _xmlDocDump référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlIsBlankNode référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlSearchNsByHref référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlFreeDoc référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlDocGetRootElement référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlParseFile référencé dans la fonction _parseGjobFile
gjobread.obj : error LNK2019: symbole externe non résolu _xmlKeepBlanksDefault référencé dans la fonction _main
gjobread.obj : error LNK2019: symbole externe non résolu _xmlCheckVersion référencé dans la fonction _main
LIBCMTD.lib(wincrt0.obj) : error LNK2019: symbole externe non résolu _WinMain@16 référencé dans la fonction _WinMainCRTStartup
Debug/xml_test.exe : fatal error LNK1120: 11 externes non résolus

Le journal de génération a été enregistré à l'emplacement "file://d:\xml_test\Debug\BuildLog.htm"
xml_test - 12 erreur(s), 0 avertissement(s)

Avez vous une idée ?
Merci d'avance
0
Oui, j'ai bien déclarer mon .lib dans "projet/proprietes/editeur de liens/entree/dépendeces suppplémentaires" mais j'ai d'autre type d'erreur :
-----
Édition des liens en cours...
LIBCD.lib(crt0dat.obj) : error LNK2005: __cinit déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: _exit déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exit déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __cexit déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __c_exit déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: ___crtExitProcess déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __C_Exit_Done déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __C_Termination_Done déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __exitflag déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __wpgmptr déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __pgmptr déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: ___winitenv déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __wenviron déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: ___initenv déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __environ déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: ___wargv déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: ___argv déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: ___argc déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __winminor déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __winmajor déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __winver déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __osver déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __osplatform déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LIBCD.lib(crt0dat.obj) : error LNK2005: __umaskval déjà défini(e) dans LIBCMTD.lib(crt0dat.obj)
LINK : warning LNK4098: conflit entre la bibliothèque par défaut 'LIBCD' et les autres bibliothèques ; utilisez /NODEFAULTLIB:library
libxmld2.lib(parser.obj) : error LNK2019: symbole externe non résolu _xmlFreeURI référencé dans la fonction _xmlParseEntityDecl
libxmld2.lib(SAX.obj) : error LNK2001: symbole externe non résolu _xmlFreeURI
libxmld2.lib(parser.obj) : error LNK2019: symbole externe non résolu _xmlParseURI référencé dans la fonction _xmlParseEntityDecl
libxmld2.lib(SAX.obj) : error LNK2001: symbole externe non résolu _xmlParseURI
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__select@20 référencé dans la fonction _xmlNanoHTTPRecv
libxmld2.lib(nanoftp.obj) : error LNK2001: symbole externe non résolu __imp__select@20
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__gethostbyname@4 référencé dans la fonction _xmlNanoHTTPConnectHost
libxmld2.lib(nanoftp.obj) : error LNK2001: symbole externe non résolu __imp__gethostbyname@4
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__getsockopt@20 référencé dans la fonction _xmlNanoHTTPConnectAttempt
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu ___WSAFDIsSet@8 référencé dans la fonction _xmlNanoHTTPConnectAttempt
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__connect@12 référencé dans la fonction _xmlNanoHTTPConnectAttempt
libxmld2.lib(nanoftp.obj) : error LNK2001: symbole externe non résolu __imp__connect@12
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__htons@4 référencé dans la fonction _xmlNanoHTTPConnectAttempt
libxmld2.lib(nanoftp.obj) : error LNK2001: symbole externe non résolu __imp__htons@4
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__ioctlsocket@12 référencé dans la fonction _xmlNanoHTTPConnectAttempt
libxmld2.lib(nanohttp.obj) : error LNK2019: symbole externe non résolu __imp__socket@12 référencé dans la fonction _xmlNanoHTTPConnectAttempt
libxmld2.lib(nanoftp.obj) : error LNK2001: symbole externe non résolu __imp__socket@12
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__gethostname@8 référencé dans la fonction _xmlNanoFTPInit
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__recv@16 référencé dans la fonction _xmlNanoFTPReadResponse
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__send@16 référencé dans la fonction _xmlNanoFTPQuit
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__ntohs@4 référencé dans la fonction _xmlNanoFTPGetConnection
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__listen@8 référencé dans la fonction _xmlNanoFTPGetConnection
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__bind@12 référencé dans la fonction _xmlNanoFTPGetConnection
libxmld2.lib(nanoftp.obj) : error LNK2019: symbole externe non résolu __imp__getsockname@12 référencé dans la fonction _xmlNanoFTPGetConnection
LIBCMTD.lib(wincrt0.obj) : error LNK2019: symbole externe non résolu _WinMain@16 référencé dans la fonction _WinMainCRTStartup
Debug/xml_test.exe : fatal error LNK1120: 18 externes non résolus
------

Merci encore une fois
0
Je suppose qu'après un mois tu as dû déjà trouvé la solution.
Sinon, ce qui cause l'erreur est probablement le fait que tu aies créé un projet contenant libxml2 dans ton propre projet. Si tu indique à l'éditeur de lien l'emplacement de libxml2.lib et le chemin des fichiers include, il n'est absolument pas nécessaire de créer un nouveau projet pour libxml2.
0

Vous n’avez pas trouvé la réponse que vous recherchez ?

Posez votre question
Bonjour,
Exact c'était la cause de l'erreur. Jai indiqué le chemin du libxml.lib et ça a marché.
Merci beaucoup
0
Lorsque j essaye de compiler fligtgear :



Édition des liens en cours...
LINK : warning LNK4075: ' /EDITANDCONTINUE' ignoré à cause de la spécification '/INCREMENTAL:NO'
tmp.obj : error LNK2001: symbole externe non résolu "void __cdecl sgdMakeCoordMat4(double (* const)[4],double,double,double,double,double,double)" (?sgdMakeCoordMat4@@YAXQAY03NNNNNNN@Z)
SchedFlight.obj : error LNK2001: symbole externe non résolu "void __cdecl sgdMakeCoordMat4(double (* const)[4],double,double,double,double,double,double)" (?sgdMakeCoordMat4@@YAXQAY03NNNNNNN@Z)
Schedule.obj : error LNK2001: symbole externe non résolu "void __cdecl sgdMakeCoordMat4(double (* const)[4],double,double,double,double,double,double)" (?sgdMakeCoordMat4@@YAXQAY03NNNNNNN@Z)
TrafficMgr.obj : error LNK2001: symbole externe non résolu "void __cdecl sgdMakeCoordMat4(double (* const)[4],double,double,double,double,double,double)" (?sgdMakeCoordMat4@@YAXQAY03NNNNNNN@Z)
...
nasal-props.obj : error LNK2019: symbole externe non résolu "public: class SGSharedPtr __thiscall SGPropertyNode::removeChild(int,bool)" (?removeChild@SGPropertyNode@@QAE?AV?$SGSharedPtr@VSGPropertyNode@@@@H_N@Z) référencé dans la fonction "union naRef __cdecl f_removeChildren(struct Context *,union naRef,int,union naRef *)" (?f_removeChildren@@YA?ATnaRef@@PAUContext@@T1@HPAT1@@Z)
fg_fx.obj : error LNK2019: symbole externe non résolu "public: __thiscall SGXmlSound::SGXmlSound(void)" (??0SGXmlSound@@QAE@XZ) référencé dans la fonction __catch$?init@FGFX@@UAEXXZ$0
tmp.obj : error LNK2019: symbole externe non résolu "public: void __thiscall SGTime::updateLocal(double,double,class std::basic_string,class std::allocator > const &)" (?updateLocal@SGTime@@QAEXNNABV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z) référencé dans la fonction "void __cdecl fgUpdateLocalTime(void)" (?fgUpdateLocalTime@@YAXXZ)
Schedule.obj : error LNK2019: symbole externe non résolu "void __cdecl sgdMakeRotMat4(double (* const)[4],double,double const * const)" (?sgdMakeRotMat4@@YAXQAY03NNQBN@Z) référencé dans la fonction "public: bool __thiscall FGAISchedule::update(long)" (?update@FGAISchedule@@QAE_NJ@Z)
.\Debug/FlightGear.exe : fatal error LNK1120: 686 externes non résolus

FlightGear - 4393 erreur(s), 1 avertissement(s)



Voila si quelqu'un peut m'aider merci
0