I tried to figure out myself but still can't figure out,
Basically there is two file, main.cpp, ParserDom.h. The ParserDom.h was located in the "html" folder which located same place as main.cpp
But when I compiled, I get error LNK2019: unresolved external symbol
which all of them referring to member function of ParserDom class. Can anyone figure out ?
I always get this kind of problem, can anyone give me some tips what is the causes and how can I avoid it in future ?
Thank you. The code was taken from http://htmlcxx.sourceforge.net/
using Visual Studion 2005
main.cpp file
ParserDom.h header file
Basically there is two file, main.cpp, ParserDom.h. The ParserDom.h was located in the "html" folder which located same place as main.cpp
But when I compiled, I get error LNK2019: unresolved external symbol
which all of them referring to member function of ParserDom class. Can anyone figure out ?
I always get this kind of problem, can anyone give me some tips what is the causes and how can I avoid it in future ?
Thank you. The code was taken from http://htmlcxx.sourceforge.net/
using Visual Studion 2005
main.cpp file
Code:
#include <iostream>
#include <string>
#include "html/ParserDom.h"
using namespace std;
using namespace htmlcxx;
int main()
{
string html = "<html><body>hey</body></html>";
HTML::ParserDom parser;
tree<HTML::Node> dom = parser.parseTree(html);
return 0;
}
Code:
#ifndef __HTML_PARSER_DOM_H__
#define __HTML_PARSER_DOM_H__
#include "ParserSax.h"
#include "tree.h"
namespace htmlcxx
{
namespace HTML
{
class ParserDom : public ParserSax
{
public:
ParserDom() {}
~ParserDom() {}
const tree<Node> &parseTree(const std::string &html);
const tree<Node> &getTree()
{ return mHtmlTree; }
protected:
virtual void beginParsing();
virtual void foundTag(Node node, bool isEnd);
virtual void foundText(Node node);
virtual void foundComment(Node node);
virtual void endParsing();
tree<Node> mHtmlTree;
tree<Node>::iterator mCurrentState;
};
std::ostream &operator<<(std::ostream &stream, const tree<HTML::Node> &tr);
} //namespace HTML
} //namespace htmlcxx
#endif
Comment