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 toTiXmlDocument::TiXmlDocument[in-charge](char const*)'
    /tmp/ccJiySri.o(.text+0x28): In function test1()': : undefined reference toTiXmlDocument::LoadFile(TiXmlEncoding)'
    /tmp/ccJiySri.o(.text+0xea): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0xff): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x114): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x129): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x13e): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x153): In function test1()': : undefined reference toTiXmlHandle::Child(int) const'
    /tmp/ccJiySri.o(.text+0x227): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x23c): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x251): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x266): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x27b): In function test1()': : undefined reference toTiXmlHandle::FirstChild(char const*) const'
    /tmp/ccJiySri.o(.text+0x290): In function test1()': : undefined reference toTiXmlHandle::Child(int) const'
    /tmp/ccJiySri.o(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev+0xc): In function TiXmlDocument::~TiXmlDocument [in-charge]()': : undefined reference tovtable for TiXmlDocument'
    /tmp/ccJiySri.o(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev+0x31): In function TiXmlDocument::~TiXmlDocument [in-charge]()': : undefined reference toTiXmlNode::~TiXmlNode [not-in-charge]()'
    /tmp/ccJiySri.o(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev+0x4d): In function TiXmlDocument::~TiXmlDocument [in-charge]()': : undefined reference toTiXmlNode::~TiXmlNode [not-in-charge]()'
    collect2: ld returned 1 exit status

    Kann 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.


Anmelden zum Antworten