定义一个structstruct  _PathNode
{
int g;
int h;
int f;
int x;
int y;
_PathNode * Parent;
_PathNode * NextNode;
_PathNode * Child[8];
}编译时显示
pp.h(9) : error C2236: unexpected 'struct' '_PathNode'
pp.h(9) : error C2143: syntax error : missing ';' before '{'
pp.h(9) : error C2447: missing function header (old-style formal list?)请大虾指点。

解决方案 »

  1.   

    struct  _PathNode
    {
    int g;
    int h;
    int f;
    int x;
    int y;
    _PathNode * Parent;
    _PathNode * NextNode;
    _PathNode * Child[8];
    }; // 注意这里的分号
      

  2.   

    而且,如果你用的是C编译方式,切记要在_PathNode之前加上struct关键字。
      

  3.   

    同意vcforever(霓裳羽衣) 
    :)
      

  4.   

    加了;突然出现下列出错误。
    c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
    c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
      

  5.   

    楼主编译的莫非是纯C程序?那样的话
    struct  _PathNode
    {
    int g;
    int h;
    int f;
    int x;
    int y;
    struct _PathNode * Parent;
    struct _PathNode * NextNode;
    struct _PathNode * Child[8];
    };
      

  6.   

    是一款游戏的服务器端,缺少一些文件。我补了些。
    编译有点问题。c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : error C2146: syntax error : missing ';' before identifier 'MMVERSION'
    c:\program files\microsoft visual studio\vc98\include\mmsystem.h(113) : fatal error C1004: unexpected end of file found
      

  7.   

    最后的“;”被你吃了?struct _PathNode
    {
    int g;
    int h;
    int f;
    int x;
    int y;
    _PathNode * Parent;
    _PathNode * NextNode;
    _PathNode * Child[8];
    };
      

  8.   

    来的都有分,呵呵。看看下面这个:c:\program files\microsoft visual studio\vc98\include\vector(17) : error C2143: syntax error : missing ';' before 'namespace'
      

  9.   

    struct _PathNode
    {
    int g;
    int h;
    int f;
    int x;
    int y;
    _PathNode * Parent;
    _PathNode * NextNode;
    _PathNode * Child[8];
    };
    结构体定义结束后要加分号。