tempad
Readygo技术搜索引擎 >>游戏开发 >> ..\vc98\include\windef.h(43) : error C2632: long followed by long is illegal

..\vc98\include\windef.h(43) : error C2632: long followed by long is illegal

Readygo技术搜索引擎 网络搜索 efish 2008-1-17 2:00:35

..\vc98\include\windef.h(43) : error C2632: "long" followed by "long" is illegal

楼主stzhou(阿毛)2002-11-22 17:38:45 在 VC/MFC / 基础类 提问

错误提示VC的头文件windef.h中的这一句有问题,怎么办?  
  typedef   unsigned   long   ULONG;  
   
  问题点数:80、回复次数:3Top

1 楼rtdb(东临碣石)回复于 2002-11-22 18:25:12 得分 30

检查你的头文件,    
  可能最后少},;   #endif   之类的.Top

2 楼cbc(逍遥子)回复于 2002-11-22 18:32:56 得分 50

From   MSDN:  
   
  CAUSE  
  This   error   occurs   as   a   result   of   MFC   using   STRICT   type   checking   by   default.   STRICT   type   checking   is   not   used   in   WINDOWS.H   unless   you   define   STRICT   as   a   preprocessor   symbol   before   including   the   header   file.    
  Specifically,   WINDOWS.H   has   the   following   statement:    
        #ifdef   STRICT  
        typedef   signed   long   LONG;  
        #else  
        #define   LONG   long  
        #endif  
   
  AFX.H   has   this   statement:    
   
      typedef   long   LONG;       //   32-bit   signed   number  
   
  As   you   can   see,   if   STRICT   type   checking   is   not   used   and   WINDOWS.H   is   included   before   AFX.H,   the   typedef   statement   in   AFX.H   becomes   the   following   (after   preprocessing):    
   
        typedef   long   long;       //   32-bit   signed   number  
  The   typedef   statement   is   used   to   create   another   name   for   an   existing   data   type.   Because   this   statement   has   not   specified   a   different   name   for   the   long   data   type,   it   is   disallowed   by   the   compiler.    
   
  RESOLUTION  
  Include   WINDOWS.H   after   the   MFC   header   files   or   not   at   all.   AFXWIN.H   automatically   includes   WINDOWS.H,   so   it   is   normally   not   necessary   to   explicitly   include   it   in   your   source   code.    
   
  Another   way   to   avoid   this   error   is   to   define   STRICT   as   a   preprocessor   symbol   before   including   WINDOWS.H.   This   will   ensure   that   LONG   is   type   defined   as   signed   long   rather   than   simply   long.    
   
  MORE   INFORMATION  
  MFC   Technical   Note   12   "Using   Windows   3.1   Robustness   Features"   contains   additional   information   on   STRICT   type   checking   and   other   Windows   3.1   robustness   features.    
   
  Sample   Code  
   
  /*   Compile   options   needed:     /D_WINDOWS   */  
   
  /*  
  #define   STRICT         //   Remove   comments   from   this   line   to   avoid   errors.  
  */  
   
  #include   <windows.h>   //   Or,   reverse   order   of   these   statements.  
  #include   <afx.h>  
   
  Top

3 楼JennyVenus()回复于 2002-11-22 18:55:33 得分 0

agree   with   rtdb(东临碣石)Top

责任编辑: efish 参与评论 查找更多:
相关文章
怎样在win2003中删除(清除)使用后的痕迹? 怎样在win2003中删除(清除)使用后的痕迹?
哪里可以找到如何写.bat批处理文件的教程啊,谢谢!! 哪里可以找到如何写.bat批处理文件的教程啊,谢谢!!
不好意思 帮忙 一下 小问题!!! (((在线等待)… 不好意思 帮忙 一下 小问题!!! (((在线等待)))
有关时间查询的问题? 有关时间查询的问题?
JSP里如何在一个Form里上传文件的同时能提交数据? JSP里如何在一个Form里上传文件的同时能提交数据?
QQ视频聊天怎么保存? QQ视频聊天怎么保存?
如何通过按钮在视图上显示内容?? 如何通过按钮在视图上显示内容??
怎么样设计一个在屏幕上显示的音量控制进度条? 怎么样设计一个在屏幕上显示的音量控制进度条?
怎么样使桌面透明??? 怎么样使桌面透明???
pb8.0 + oracle 8.1.7发布问题,需要哪些DLL pb8.0 + oracle 8.1.7发布问题,需要哪些DLL
2秒记住本站域名

玩过泡泡龙吗?Readygo?Go! 再加上.Com.Cn的后缀,那就是大名小顶的readygo.com.cn

分类导航
Readygo技术搜索引擎