简体   繁体   English

使用 TDM-GCC 4.9.2 的 DevC++ IDE 中的额外资格错误

[英]extra qualification error in DevC++ IDE with TDM-GCC 4.9.2

I have a class function that is defined as follows:我有一个 class function 定义如下:

class Output 
{ 

private:

window* pWind;  

public:

Output();

    window* CreateWind(int, int, int, int);
    void CreateDesignToolBar(); //Tool bar of the design mode
    void CreateSimulationToolBar();//Tool bar of the simulation mode
    window * getwindow()const;
    void CreateStatusBar();
    void CreateDrawArea();

    Input* CreateInput(); //creates a pointer to the Input object   
    void ClearStatusBar();  //Clears the status bar
    void ClearDrawArea();   //Clears the drawing area

    void DrawAssign(Point Left, int width, int height, string Text, bool Selected = false);
   void Output::Drawcondition(Point left, int width, int height, int t_width, int t_height, string Text, bool Selected = false);

When I compile the source in DevC++, I get:当我在 DevC++ 中编译源代码时,我得到:

33 7 C:\Users\user\source\repos\flowchart-designer-and-simulator\GUI\Output.h [Error] extra qualification 'Output::' on member 'Drawcondition' [-fpermissive] 33 7 C:\Users\user\source\repos\flowchart-designer-and-simulator\GUI\Output.h [错误] 成员 'Drawcondition' 上的额外限定 'Output::' [-fpermissive]

What is this?这是什么? How do I remove this error?如何消除此错误?

First of all, Dev-C++ is not a compiler, but an IDE (a fancy editor, simply said).首先,Dev-C++不是编译器,而是一个IDE(一个花哨的编辑器,简单的说)。 It uses some kind of other compiler under the bonnet.它在引擎盖下使用某种其他编译器。 Proabably gcc (from MINGW), I don't really remember, as Dev-C++ is quite dated tool.可能是 gcc(来自 MINGW),我不记得了,因为 Dev-C++ 是相当过时的工具。

Secondly, you have not given full code (EDIT: full code was added later), but based on the error I think you have declared a method inside of class and qualified it with that class name.其次,您没有提供完整代码(编辑:稍后添加了完整代码),但基于错误,我认为您已经在 class 中声明了一个方法,并使用该 class 名称对其进行了限定。 This is incorrect, as qualification there is not needed.这是不正确的,因为不需要资格。

Ie you should do something like this:即你应该做这样的事情:

class Test {
        void test ();
};

Not something like this (which, I presume, you have tried):不是这样的(我想你已经尝试过):

class Test {
        void Test::test ();
};

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM