OK, I only started using Code::Blocks recently, as it's quite easy to setup a good toolchain when developing for the 'GP2X'.
It's a Linux-based handheld console.
Anyway, I know the toolchain is working fine and is all setup OK because i've been compiling stuff with no issues. Recently, however, I came to include
tinyXML in a wrapper I created a while ago called tinyWrap. Baring in mind i'm a Visual Studio zealot, I am obviously doing something hideously wrong here because even though I *think* I'm linked with the libraries correctly, I'm still receiving the following error:
.objs\tW_Element.o: In function `tW_Element::GetChild(char const*)':
tW_Element.cpp:(.text+0x288): undefined reference to `TiXmlNode::FirstChildElement(char const*)'
.objs\tW_Element.o: In function `tW_Element::GetNextSibling(char const*)':
tW_Element.cpp:(.text+0x338): undefined reference to `TiXmlNode::NextSiblingElement(char const*)'
.objs\tW_Element.o: In function `tW_Element::GetChildCount(char const*)':
tW_Element.cpp:(.text+0x3dc): undefined reference to `TiXmlNode::FirstChildElement(char const*)'
tW_Element.cpp:(.text+0x430): undefined reference to `TiXmlNode::NextSiblingElement(char const*)'
.objs\tW_Element.o: In function `tW_Element::AttributeInt(char const*)':
tW_Element.cpp:(.text+0x524): undefined reference to `TiXmlElement::Attribute(char const*, int*) const'
.objs\tW_Element.o: In function `tW_Element::AttributeDouble(char const*)':
tW_Element.cpp:(.text+0x564): undefined reference to `TiXmlElement::Attribute(char const*, double*) const'
.objs\tW_Element.o: In function `tW_Element::AttributeChars(char const*)':
tW_Element.cpp:(.text+0x5a8): undefined reference to `TiXmlElement::Attribute(char const*) const'
.objs\tW_Element.o: In function `tW_Element::AttributeWChars(char const*, wchar_t*)':
tW_Element.cpp:(.text+0x5f0): undefined reference to `TiXmlElement::Attribute(char const*) const'
.objs\tW_Element.o: In function `tW_Element::ParseFloat(float*)':
tW_Element.cpp:(.text+0x638): undefined reference to `TiXmlElement::GetText() const'
.objs\tW_Element.o: In function `tW_Element::ParseFloatArray(float*, int)':
tW_Element.cpp:(.text+0x780): undefined reference to `TiXmlElement::GetText() const'
.objs\tW_Element.o: In function `tW_Element::ParseVector(float*)':
tW_Element.cpp:(.text+0x938): undefined reference to `TiXmlElement::GetText() const'
.objs\tW_Element.o: In function `tW_Element::ParseVectorArray(float*, int)':
tW_Element.cpp:(.text+0xaf0): undefined reference to `TiXmlElement::GetText() const'
.objs\tW_Element.o: In function `tW_Element::ParseIntArray(int*, int)':
tW_Element.cpp:(.text+0xcc0): undefined reference to `TiXmlElement::GetText() const'
.objs\tinyWrap.o: In function `tinyWrap::tinyWrap()':
tinyWrap.cpp:(.text+0x58): undefined reference to `TiXmlDocument::TiXmlDocument()'
.objs\tinyWrap.o: In function `tinyWrap::tinyWrap()':
tinyWrap.cpp:(.text+0x198): undefined reference to `TiXmlDocument::TiXmlDocument()'
.objs\tinyWrap.o: In function `tinyWrap::OpenFile(char const*)':
tinyWrap.cpp:(.text+0x4c8): undefined reference to `TiXmlDocument::TiXmlDocument(char const*)'
tinyWrap.cpp:(.text+0x4e0): undefined reference to `TiXmlDocument::operator=(TiXmlDocument const&)'
tinyWrap.cpp:(.text+0x4f0): undefined reference to `TiXmlDocument::LoadFile(TiXmlEncoding)'
.objs\tinyWrap.o: In function `tinyWrap::SetRoot(char const*)':
tinyWrap.cpp:(.text+0x614): undefined reference to `TiXmlNode::FirstChildElement(char const*)'
.objs\tinyWrap.o: In function `TiXmlString::quit()':
tinyWrap.cpp:(.gnu.linkonce.t._ZN11TiXmlString4quitEv[_ZN11TiXmlString4quitEv]+0x4c): undefined reference to `TiXmlString::nullrep_'
.objs\tinyWrap.o: In function `TiXmlDocument::~TiXmlDocument()':
tinyWrap.cpp:(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev[_ZN13TiXmlDocumentD1Ev]+0x40): undefined reference to `TiXmlNode::~TiXmlNode()'
tinyWrap.cpp:(.gnu.linkonce.t._ZN13TiXmlDocumentD1Ev[_ZN13TiXmlDocumentD1Ev]+0x60): undefined reference to `vtable for TiXmlDocument'
Process terminated with status 1 (0 minutes, 2 seconds)
As far as I can see, this can
only be a linker error.
To link the libraries (lib\tinyxmld.lib and lib\tinyxml.lib) I am going to the project's Build Options -> Linker & adding both these library files into "Link Libraries".
So...what am I doing wrong? :s
(I am using a custom compiler with custom rules - is there something I have to setup to explicity
allow linking?)