"undefined reference" bei xml2 Library

Post Reply
Message
Author
Th0mmas
Posts: 2
Joined: 21. Nov 2011 21:33
Location: Deutschland

"undefined reference" bei xml2 Library

#1 Post by Th0mmas »

Hallo,
ich versuche seit einiger Zeit, ein Programm zu erstellen, das die Bibliothek xml2 nutzt. Das Problem ist, dass beim Linken Referenzen nicht aufgelöst werden:

Code: Select all

thomas@compi:/tmp$ cc `xml2-config --cflags --libs` a.c
/tmp/ccWYVN60.o: In function `main':
a.c:(.text+0xa1): undefined reference to `xmlCheckVersion'
a.c:(.text+0xbe): undefined reference to `xmlReadFile'
a.c:(.text+0xff): undefined reference to `xmlDocGetRootElement'
a.c:(.text+0x11b): undefined reference to `xmlFreeDoc'
a.c:(.text+0x120): undefined reference to `xmlCleanupParser'
collect2: ld gab 1 als Ende-Status zurück
thomas@compi:/tmp$ 
Um sicherzustellen, dass die richtigen Compiler- / Linkerparameter verwendet werden, nutze ich "xml2-config":

Code: Select all

thomas@vcompi:/tmp$ echo `xml2-config --cflags --libs` 
-I/usr/include/libxml2 -lxml2
thomas@compi:/tmp$ 
Die Bibliothek xml2 ist installiert:

Code: Select all

thomas@compi:/tmp$ sudo apt-get install libxml2 libxml2-dev
Paketlisten werden gelesen... Fertig
Abhängigkeitsbaum wird aufgebaut       
Status-Informationen einlesen... Fertig
libxml2 ist schon die neueste Version.
libxml2-dev ist schon die neueste Version.
0 aktualisiert, 0 neu installiert, 0 zu entfernen und 0 nicht aktualisiert.
thomas@compi:/tmp$
Ich nutze Ubuntu 11.10 64 Bit.

Für Ideen wo das Problem liegen könnte, wäre ich dankbar!
--Thomas

Th0mmas
Posts: 2
Joined: 21. Nov 2011 21:33
Location: Deutschland

#2 Post by Th0mmas »

Die Lösung meines Problems wurde in einem anderen Forum gefunden: http://forum.ubuntuusers.de/topic/undef ... st-3662767
--Thomas

Post Reply