undefined
11-03-2004, 15:38
Ich versuche mich gerade in C++ und habe probleme eine Klasse richtig anzusprechen oder besser gesagt überhaupt auf sie zu zugreifen.
Mein bisheriges gemenge ;)
/**
* libxml++
* /usr/include/libxml++-1.0/libxml++/libxml++.h
* Tutorial oder Beispiel Script von cvs.sourceforge.net:
* http://cvs.sourceforge.net/viewcvs.py/libxmlplusplus/libxml++/examples/dom_parser/main.cc?rev=1.25&view=auto
*/
#include <libxml++/libxml++.h>
#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
std::string xmldatei;
bool set = true;
if (argc > 1) {
xmldatei = argv[1];
} else {
xmldatei = "test.xml";
}
/**
* domparser.h
* xmlpp::DomParser::DomParser()
*/
xmlpp::DomParser parser;
/**
* parser.h
* Validieren
* virtual void set_validate (bool val=true)
*/
parser.set_validate(set);
/**
* domparser.h
* virtual void xmlpp::DomParser::parse_file(const std::string & filename) [virtual]
*/
parser.parse_file(xmldatei);
if(parser)
std::cout << "OK???" << std::endl;
return 0;
}
Nun bekomme ich diese Fehler Meldung kann sie nicht richtig einordnen.
g++ -I`xml2-config --cflags` -I/usr/include/libxml++-1.0/ -L`xml2-config --libs` -dd -Wall xmlread.cpp
/tmp/cc9DErIl.o(.text+0x5f): In function `main':
: undefined reference to `xmlpp::DomParser::DomParser[in-charge]()'
/tmp/cc9DErIl.o(.text+0x77): In function `main':
: undefined reference to `xmlpp::Parser::set_validate(bool)'
/tmp/cc9DErIl.o(.text+0x8a): In function `main':
: undefined reference to `xmlpp::DomParser::parse_file(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/cc9DErIl.o(.text+0x99): In function `main':
u.s.w ...
Ich verstehe sie nicht ganz weil die Klasse auch vorhanden ist.
danke für die Hilfe ;)
Mein bisheriges gemenge ;)
/**
* libxml++
* /usr/include/libxml++-1.0/libxml++/libxml++.h
* Tutorial oder Beispiel Script von cvs.sourceforge.net:
* http://cvs.sourceforge.net/viewcvs.py/libxmlplusplus/libxml++/examples/dom_parser/main.cc?rev=1.25&view=auto
*/
#include <libxml++/libxml++.h>
#include <iostream>
#include <string>
int main(int argc, char* argv[])
{
std::string xmldatei;
bool set = true;
if (argc > 1) {
xmldatei = argv[1];
} else {
xmldatei = "test.xml";
}
/**
* domparser.h
* xmlpp::DomParser::DomParser()
*/
xmlpp::DomParser parser;
/**
* parser.h
* Validieren
* virtual void set_validate (bool val=true)
*/
parser.set_validate(set);
/**
* domparser.h
* virtual void xmlpp::DomParser::parse_file(const std::string & filename) [virtual]
*/
parser.parse_file(xmldatei);
if(parser)
std::cout << "OK???" << std::endl;
return 0;
}
Nun bekomme ich diese Fehler Meldung kann sie nicht richtig einordnen.
g++ -I`xml2-config --cflags` -I/usr/include/libxml++-1.0/ -L`xml2-config --libs` -dd -Wall xmlread.cpp
/tmp/cc9DErIl.o(.text+0x5f): In function `main':
: undefined reference to `xmlpp::DomParser::DomParser[in-charge]()'
/tmp/cc9DErIl.o(.text+0x77): In function `main':
: undefined reference to `xmlpp::Parser::set_validate(bool)'
/tmp/cc9DErIl.o(.text+0x8a): In function `main':
: undefined reference to `xmlpp::DomParser::parse_file(std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
/tmp/cc9DErIl.o(.text+0x99): In function `main':
u.s.w ...
Ich verstehe sie nicht ganz weil die Klasse auch vorhanden ist.
danke für die Hilfe ;)