Windows 错误C2146和C4430

Windows 错误C2146和C4430,windows,Windows,第一:对不起,我的英语不好=(( 第二点: 以下是我在“Global.h”中的代码: }) 我有一些爱神:( 但在我删除了GlobalVariable类之后!只存在类Point、Color、DaGiac、Circle!它没有eror! 告诉我为什么?以及如何更正该错误?请=(编译器无法“查看”其他类,因为它们是在GlobalVariable类之后定义的。将整个GlobalVariable类移到文件底部,以便在需要时定义它所依赖的所有类 #pragma once class GlobalVar

第一:对不起,我的英语不好=((

第二点:

以下是我在“Global.h”中的代码:

})


我有一些爱神:(


但在我删除了GlobalVariable类之后!只存在类Point、Color、DaGiac、Circle!它没有eror! 告诉我为什么?以及如何更正该错误?请=(

编译器无法“查看”其他类,因为它们是在
GlobalVariable
类之后定义的。将整个
GlobalVariable
类移到文件底部,以便在需要时定义它所依赖的所有类

#pragma once
class GlobalVariable
{
public:
    GlobalVariable(void);
    ~GlobalVariable(void);

    //------------------------------------------------
public:
    double pixelWidth;      //  do rong cua 1 pixel tren Viewport
    double pixelHeigh;      //  do cao cua 1 pixel tren Viewport

public:
    Point   oldPoint,   tempPoint;
    Circle  oldCir,     tempCir;
    DaGiac  oldDaGiac,  tempDaGiac;
    Color   oldObjColor,tempObjColor, OxyColor;

};

class Point
{
public:
    Point(void);
    ~Point(void);

    double  x,y;            // toạ độ (x,y)
};

class Color
{
public:
    Color(void);
    ~Color(void);

    double R,G,B;           // màu (R,G,B)
};

class DaGiac
{
public:
    DaGiac(void);
    ~DaGiac(void);

    int numOfPeak;  //so' dinh?
    Point peakArr[10];  //  ve da giac canh so dinh toi da la 10
};

class Circle
{
public:
    Circle(void);
    ~Circle(void);

    Point centre;
    double radius;
------ Build started: Project: GAS, Configuration: Debug Win32 ------
Compiling...
GlobalVariable.cpp
e:\documents\bin\gas_project\globalvariable.h(15) : error C2146: syntax error : missing ';' before identifier 'oldPoint'
e:\documents\bin\gas_project\globalvariable.h(15) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(15) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(15) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(16) : error C2146: syntax error : missing ';' before identifier 'oldCir'
e:\documents\bin\gas_project\globalvariable.h(16) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(16) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(16) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(17) : error C2146: syntax error : missing ';' before identifier 'oldDaGiac'
e:\documents\bin\gas_project\globalvariable.h(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(17) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(18) : error C2146: syntax error : missing ';' before identifier 'oldObjColor'
e:\documents\bin\gas_project\globalvariable.h(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
e:\documents\bin\gas_project\globalvariable.h(18) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
Build log was saved at "file://e:\Documents\BIN\GAS_Project\Debug\BuildLog.htm"
GAS - 17 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========