tinyxml compilieren
-
Ich habe nun schoen oefters hier gelesen, dass tinyxml ein guter und relativ einfacher xml parser sei.
Vielleicht kann mir auch hier jemand weiterhelfen.ich inkludiere die tinyxml bibliothek wie folgt
#include "tinyxml/tinyxml.h"
// der pfad ist auch korrekt.
nur wenn ich das ganze nun compilieren(gcc/linux) will z.B. g++ name.cpp -o name
dann schreibt er folgende fehlermeldung:/tmp/ccJiySri.o(.text+0x17): In function
test1()': : undefined reference to
TiXmlDocument::TiXmlDocument[in-charge](char const*)'
/tmp/ccJiySri.o(.text+0x28): In functiontest1()': : undefined reference to
TiXmlDocument::LoadFile(TiXmlEncoding)'
/tmp/ccJiySri.o(.text+0xea): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0xff): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x114): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x129): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x13e): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x153): In functiontest1()': : undefined reference to
TiXmlHandle::Child(int) const'
/tmp/ccJiySri.o(.text+0x227): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x23c): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x251): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x266): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x27b): In functiontest1()': : undefined reference to
TiXmlHandle::FirstChild(char const*) const'
/tmp/ccJiySri.o(.text+0x290): In functiontest1()': : undefined reference to
TiXmlHandle::Child(int) const'
/tmp/ccJiySri.o(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev+0xc): In functionTiXmlDocument::~TiXmlDocument [in-charge]()': : undefined reference to
vtable for TiXmlDocument'
/tmp/ccJiySri.o(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev+0x31): In functionTiXmlDocument::~TiXmlDocument [in-charge]()': : undefined reference to
TiXmlNode::~TiXmlNode [not-in-charge]()'
/tmp/ccJiySri.o(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev+0x4d): In functionTiXmlDocument::~TiXmlDocument [in-charge]()': : undefined reference to
TiXmlNode::~TiXmlNode [not-in-charge]()'
collect2: ld returned 1 exit statusKann irgendjemand mit dieser Meldung was anfagen?
Darf ich das so compilieren oder muss ich dazu ein Makefile erstellen?lg
michi
-
DAS SIND LINKERFEHLER! TINYXML LIB IRGENDWIE DAZULINKEN!
-
Und jetzt die Antwort in Nett:
TinyXML liefert nur die Source codes, keine DLLs oder so. Demnach ist es noch nicht kompiliert. Der Grund: Alle Dateien von TinyXML (außer den Samples) müssen mit Kompiliert und gelinkt werden (also da ich annehme das du ne IDE benutzt: Einfach ins das projekt mit einfügen). Dann sollte es klappen.