Hi,
I am trying to use TinyXml to read and write xml.
I declared a string:
const char *TASK_FILE = "Tasks.xml"
and want to reference it in the TiXmlDocument constructor, but I get the following errors:
1 2 3 4 5 6 7 8
obj/Debug/main.o||In function `addTask(Task const&)':|
/home/kira/Projects/TaskMan/main.cpp|17|undefined reference to `TiXmlDocument::TiXmlDocument(char const*)'|
obj/Debug/main.o||In function `TiXmlString::quit()':|
/usr/include/tinystr.h|255|undefined reference to `TiXmlString::nullrep_'|
obj/Debug/main.o||In function `~TiXmlDocument':|
/usr/include/tinyxml.h|1402|undefined reference to `vtable for TiXmlDocument'|
/usr/include/tinyxml.h|1402|undefined reference to `TiXmlNode::~TiXmlNode()'|
||=== Build finished: 4 errors, 0 warnings ===|
The constructor is defined as:
TiXmlDocument( const char * documentName );
Thank you.
PS: I also tried to write this line:
TiXmlDocument doc("Tasks.xml");
but it's not accepted, returning same errors.
Add its library to the compiler options. I assume it must be something like -ltinyxml. For a library called libname.a, the option would be -lname. The library is probably in /usr/lib.