游戏开发论坛

 找回密码
 立即注册
搜索
查看: 2981|回复: 2

怎么总出现类变量的错误??

[复制链接]

22

主题

54

帖子

60

积分

注册会员

Rank: 2

积分
60
发表于 2005-6-13 21:52:00 | 显示全部楼层 |阅读模式
--------------------Configuration: OpenGLWnd - Win32 Debug--------------------
Compiling...
OpenGLFrame.cpp
d:\bak\programs\vc库\project\opengl example\openglwnd\openglframe.h(17) : error C2143: syntax error : missing ';' before '*'
d:\bak\programs\vc库\project\opengl example\openglwnd\openglframe.h(17) : error C2501: 'graphic' : missing storage-class or type specifiers
d:\bak\programs\vc库\project\opengl example\openglwnd\openglframe.h(17) : error C2501: 'm_graphic1' : missing storage-class or type specifiers
D:\Bak\Programs\VC库\PROJECT\OpenGL Example\OpenGLWnd\OpenGLFrame.cpp(84) : error C2065: 'm_graphic' : undeclared identifier
D:\Bak\Programs\VC库\PROJECT\OpenGL Example\OpenGLWnd\OpenGLFrame.cpp(84) : error C2227: left of '-&gtoint' must point to class/struct/union
Generating Code...
Compiling...
OpenGLWnd.cpp
d:\bak\programs\vc库\project\opengl example\openglwnd\openglframe.h(17) : error C2143: syntax error : missing ';' before '*'
d:\bak\programs\vc库\project\opengl example\openglwnd\openglframe.h(17) : error C2501: 'graphic' : missing storage-class or type specifiers
d:\bak\programs\vc库\project\opengl example\openglwnd\openglframe.h(17) : error C2501: 'm_graphic1' : missing storage-class or type specifiers
Generating Code...
Error executing cl.exe.

OpenGLWnd.exe - 8 error(s), 0 warning(s)

全部都是照着书上打的,只是名字不同而已,但在书的源程序上改又得,是什么回事??哪位大侠帮改改??

sf_200561321526.rar

13.17 KB, 下载次数:

42

主题

334

帖子

344

积分

中级会员

Rank: 3Rank: 3

积分
344
发表于 2005-6-13 22:16:00 | 显示全部楼层

Re:怎么总出现类变量的错误??

#include "graphic.h"           //OpenGLFrame.h中少了这个引用说明
class OpenGLFrame  
{
public:
        OpenGLFrame();
        virtual ~OpenGLFrame();
        graphic *m_graphic;
        HDC hDC;
        HGLRC hRC;
        BOOL SetupPixelFormat(HDC hDC);
        void init(int Width,int Height);
        void Render();
        void CleanUp();
//        OpenGLFrame* m_OpenGL;
};

22

主题

54

帖子

60

积分

注册会员

Rank: 2

积分
60
 楼主| 发表于 2005-6-15 21:58:00 | 显示全部楼层

Re:怎么总出现类变量的错误??

哦,我懂得了,谢谢!!!!谢谢!!!!!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

作品发布|文章投稿|广告合作|关于本站|游戏开发论坛 ( 闽ICP备17032699号-3 )

GMT+8, 2025-12-26 00:40

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表