I'm writing a static library that uses PugiXml for xml parsing. Here is the linker output from Visual Studio 2010 (I've replaced the symbol with ellipses for readability):
error LNK2019: unresolved external symbol "public: __thiscall Dae_Library<class Dae_Geometry>::Dae_Library<class Dae_Geometry>(void)" (...) referenced in function "private: bool __thiscall Dae_Doc::ParseDae(void)" (...)
error LNK2019: ^ "public: wchar_t const * __thiscall pugi::xml_node::name(void)const " (...) referenced in function "private: bool __thiscall Dae_Doc::ParseDae(void)" (...)
error LNK2001: ^ "public: wchar_t const * __thiscall pugi::xml_node::name(void)const " (...)
error LNK2019: ^ "public: wchar_t const * __thiscall pugi::xml_attribute::value(void)const " (...) referenced in function "public: void __thiscall Dae_Node::SetXmlNode(class pugi::xml_node &)" (...)
error LNK2019: ^ "public: class pugi::xml_attribute __thiscall pugi::xml_node::attribute(wchar_t const *)const " (...) referenced in function "public: void __thiscall Dae_Node::SetXmlNode(class pugi::xml_node &)" (...)
Things I've tried:
- Explicitly instantiating my template class.
- Linking PugiXml source in with test project (it is currently with the static lib I'm building)
- Building PugiXml as a static lib and referencing it in both my lib project and the test project
- Writing do nothing functions in place of my pure virtual functions.
- Providing default constructors that do not reference pugixml at all
This has been driving me nuts for the past two days and I really have no idea what to do. If anyone can give me any direction at all I would greatly appreciate it!
Edit: It's worth noting that creating a simple static library that uses pugixml compiles and tests fine, so maybe there is something wrong with how I've written my templates and classes?