Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Why can't I define a NativeParser object?

(1/1)

bruce:
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.


--- Code: ---#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.
    }
}

--- End code ---


And the compiler logs are as follows.

--- Code: ---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

--- End code ---

    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. ???

ollydbg:
1,

--- Quote ---undefined reference to `NativeParser::NativeParser()'
--- End quote ---
You should have some cpp file in your project, like nativeparser.cpp.
BTW: I can try to see parser test project as a reference.
/src/plugins/codecompletion/parser/parsertest.cbp

2, Chinese chars in your path may cause some compiler error. So I suggest avoid this.

oBFusCATed:
bruce:
Keep in mind that this code is not part of the public SDK and might change without notice.
The code for the plublic SDK is in src/include and src/sdk/.
All the other code is privet in regard to plugin writers.

Navigation

[0] Message Index

Go to full version