I have a xml file I want to navigate and I have a library to process
it. But I want also to manage that file as an object to make clear and
efficient code.
So I coded two class which one is like recursive as like as in this
example:
class B : public xmlnode
{
public:
B(xmlnode* member);
Here the attachment for smallest and simplest demo application which at Button1 click should read the xml file and show in the edit box its value and instead I get this error:
1>prova_tinyxmlDlg.obj : error LNK2019: unresolved external symbol "public: char const * __thiscall documentTinyNode::GetAttribute(char const *)" (?GetAttribute@documentTinyNode@@QAEPBDPBD@Z) referenced in function "public: void __thiscall Cprova_tinyxmlDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@Cprova_tinyxmlDlg@@QAEXXZ)
1>prova_tinyxmlDlg.obj : error LNK2019: unresolved external symbol "public: class documentTinyNode * __thiscall documentTinyNode::Node(char const *,char const *,char const *)" (?Node@documentTinyNode@@QAEPAV1@PBD00@Z) referenced in function "public: void __thiscall Cprova_tinyxmlDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@Cprova_tinyxmlDlg@@QAEXXZ)
1>prova_tinyxmlDlg.obj : error LNK2019: unresolved external symbol "public: class documentTinyNode * __thiscall documentTinyXML::Node(char const *,char const *,char const *)" (?Node@documentTinyXML@@QAEPAVdocumentTinyNode@@PBD00@Z) referenced in function "public: void __thiscall Cprova_tinyxmlDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@Cprova_tinyxmlDlg@@QAEXXZ)
1>prova_tinyxmlDlg.obj : error LNK2019: unresolved external symbol "public: __thiscall documentTinyXML:ocumentTinyXML(char const *)" (??0documentTinyXML@@QAE@PBD@Z) referenced in function "public: void __thiscall Cprova_tinyxmlDlg::OnBnClickedButton1(void)" (?OnBnClickedButton1@Cprova_tinyxmlDlg@@QAEXXZ)
1>I:\projects\project_tests\prova_tinyxml\Debug\prova_tinyxml.exe : fatal error LNK1120: 4 unresolved externals
Hi,
This error: "error LNK2019: unresolved external symbol .. " said
Linker could not find and definition of "documentTinyNode::GetAttribute" (for example)
Take note in your documentTinyNode class has only declaration of GetAttribute method.
and u must implement documentTinyNode::GetAttribute to resolve LNK2019 error
Sorry I forgot something to attach in the package source... here the correct attachment test example... as you can see there are in the .cpp implementations of GetAttribute, SetAttribute and B:Node... but I still get that error...
Sorry I forgot something to attach in the package source... here the correct attachment test example... as you can see there are in the .cpp implementations of GetAttribute, SetAttribute and B:Node... but I still get that error...
Thanks
Ciao
Luigi
Your source code (prova_tinyxmlDlg.cpp) still missing implement documentTinyXML::Node(..)
Please complete implementation and rebuild your project
as an override of the documentTinyNode's function to get a node object... but those two classes aren't of same parent but just different objects... how it should be implemented then?...
Hi,
First of all, You should take a look at http://w3schools.com/xml/xml_tree.asp
"XML documents must contain a root element. This element is "the parent" of all other elements..."
As Xml document tree
the documentTinyXML class should be
class documentTinyXML
{
.....
public:
List<documentTinyNode> GetChildNodes(); // Return a collection of xmlNode
};
There is a good book Programming - Object-Oriented Analysis and Design - C++ to read
and your choose are yours
* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.