I'd like define a NativeParser object to help me to parse a specific file and get the information I need. But the compiler tells me that my definition has something wrong.I am confused.
The code of the key part is as follows.
#include "G:\codeblocks-10.05-release\src\plugins\codecompletion\nativeparser.h"
void myHello::OnMyHello(wxCommandEvent &event)
{
LogManager* lm = Manager::Get()->GetLogManager();
NativeParser np;
Parser *par = np.GetParserPtr();
par->Parse(_("E:\\PolynomialProblem(HDOJ).cpp")); //I want to use the parser to parse the specific file.
//to process the parsing results;
TokensTree * tt = par->GetTokens();
for(int i=0; i<tt->size(); ++i)
{
Token* t = tt->at(i);
lm->Log(t->m_Name); //to output the useful information to the CB.
}
}
And the compiler logs are as follows.
Compiling: myHello.cpp
Linking dynamic library: myHello.dll
.objs\myHello.o:E:/C盘/hello/myHello.cpp:177: undefined reference to `NativeParser::NativeParser()'
.objs\myHello.o:E:/C盘/hello/myHello.cpp:180: undefined reference to `Parser::Parse(wxString const&, bool, LoaderBase*)'
.objs\myHello.o:E:/C盘/hello/myHello.cpp:183: undefined reference to `TokensTree::size()'
.objs\myHello.o:E:/C盘/hello/myHello.cpp:187: undefined reference to `NativeParser::~NativeParser()'
.objs\myHello.o:E:/C盘/hello/myHello.cpp:187: undefined reference to `NativeParser::~NativeParser()'
.objs\myHello.o:G:/codeblocks-10.05-release/src/plugins/codecompletion/parser/token.h:156: undefined reference to `TokensTree::GetTokenAt(int)'
collect2: ld returned 1 exit status
Process terminated with status 1 (0 minutes, 4 seconds)
6 errors, 0 warnings
I have read the source files of the codecompletion plugin for some time. Maybe I didn't master this classes well. I need your suggestions. ???