C++ - 错误C4430:缺少类型说明符(对于构造函数???)

TAT*_*ATN 1 c++

自昨晚以来,我一直坚持这一点,对于我的生活,我一直无法弄清楚为什么会这样.我必须错过一些非常简单的事情.

我正在制作一个OpenGL程序.在这个程序中,我正在制作一个DialogBox类.以下是代码:

//---------------------------------------------------------------
//DialogBox.h
//---------------------------------------------------------------

#include <vector>

class DialogBox
{
    private:

      float X; float Y; float Z;
      float Width;
      float Height;

      float RED;
      float GREEN;
      float BLUE;
      float ALPHA;

      int currentLine; 
      int maxLines;    //How many lines of text this dialog box can hold
      int maxChars;    //How many chars each line of text can hold

      std::vector< std::vector<char> >Text; //Text contents of the Dialog Box

      unsigned int vertexArray_DialogBox;
      unsigned int vertexBuffer_DialogBox;


   public:

      DialogBox();
      DialogBox(float width, float height);

      void draw();
      void draw(float x, float y, float z);

};

//------------------------------------------------------------------------
//DialogBox.cpp
//------------------------------------------------------------------------

#include <iostream>
#include "DialogBox.h"

DialogBox::DialogBox()
{
    X = 0.0f; Y = 0.0f; Z = 0.0f;

    Width = 1.0f;
    Height = 1.0f;

    RED = 0.0f;
    GREEN = 1.0f;
    BLUE = 1.0f;
    ALPHA = 1.0f;

    //For HELVETICA_18 ----------------------
    static const float letter_width = 0.03f;
    static const float letter_height = 0.04f;
    static const float line_height = 0.1f;
    //---------------------------------------


   maxLines = Height / line_height - 4; 
   maxChars = Width / letter_width - 2; 

   Text.resize(maxLines);
   for(int i = 0; i < maxLines; i++)
   {
       Text[i].resize(maxChars);
   }
}

DialogBox::DialogBox(float width, float height)
{
    Width = width;
    Height = height;
    //The rest of the initialization codes
}

void DialogBox::draw()
{
    //OpenGL Drawing codes
}

void DialogBox::draw(float x, float y, float z)
{
    X = x; Y = y; Z = z;
    draw();
}
Run Code Online (Sandbox Code Playgroud)

并且编译器抛出了以下错误消息:

在此输入图像描述

我一直在拉我的头发,但我无法弄清楚编译器指的是什么.它必须是非常简单的东西(如代码中的拼写错误或类似的东西).预先感谢您的帮助.

asc*_*ler 7

那条警告在同一条线上是什么?

没有足够的实际参数宏'DialogBoxA'

DialogBox一个#define-d宏?如果是这样,那可能会搞砸了.

  • 你是否包括Windows.h?它有一个[DialogBox](http://msdn.microsoft.com/en-gb/library/windows/desktop/ms645452%28v=vs.85%29.aspx)宏. (2认同)