'CListCtrl' : missing storage-class or type specifiers问题

edenliuL 2013-07-05 04:07:20
我程序里面用到一个common模块 里面是一些要用的函数,在其他程序上用没问题,但是在这次的使用上就出现问题了
我首先把错误信息发下:
e:\c++\xmlser\common\commonfun.h(428) : error C2146: syntax error : missing ';' before identifier 'listctrl'
e:\c++\xmlser\common\commonfun.h(428) : error C2501: 'CListCtrl' : missing storage-class or type specifiers
e:\c++\xmlser\common\commonfun.h(428) : error C2501: 'listctrl' : missing storage-class or type specifiers
e:\c++\xmlser\common\commonfun.h(452) : error C2146: syntax error : missing ';' before identifier 'LoadSysStr'
e:\c++\xmlser\common\commonfun.h(452) : error C2501: 'CString' : missing storage-class or type specifiers
e:\c++\xmlser\common\commonfun.h(452) : fatal error C1004: unexpected end of file found
对应第一个错误的代码是:
struct SortData
{
CListCtrl* listctrl; //CListCtrl控件指针就是这里啦!!
int isub; //l列号
int seq; //1为升序,0为降序
};
头文件包含在里面呀 怎么CListCtrl和CString都不能用了呢 ?
...全文
167 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
edenliuL 2013-07-08
  • 打赏
  • 举报
回复
引用
问题解决了 是编译环境设置的问题。。在VC的setting里选择c/c++选项 选择里面的Preprocessor 里面加上了 ./ 和./xml 就可以了
zhugay 2013-07-05
  • 打赏
  • 举报
回复
stdafx文件默认生成时就包含了头文件的。
//

#if !defined(AFX_STDAFX_H__3A72B905_628E_468A_98BC_C4410C2F4756__INCLUDED_)
#define AFX_STDAFX_H__3A72B905_628E_468A_98BC_C4410C2F4756__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#define VC_EXTRALEAN		// Exclude rarely-used stuff from Windows headers

#include <afxwin.h>         // MFC core and standard components
#include <afxext.h>         // MFC extensions
#include <afxdisp.h>        // MFC Automation classes
#include <afxdtctl.h>		// MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h>			// MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
ponydph 2013-07-05
  • 打赏
  • 举报
回复
头文件 listctrl的
gg606 2013-07-05
  • 打赏
  • 举报
回复
是不是没有#include "stdafx.h"呀?
碼上道 2013-07-05
  • 打赏
  • 举报
回复
CListCtrl 这个类没有定义或者声明一下,有时候也有可能前面有分号没有加导致错误的提示。

16,472

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC相关问题讨论
社区管理员
  • 基础类社区
  • Web++
  • encoderlee
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

        VC/MFC社区版块或许是CSDN最“古老”的版块了,记忆之中,与CSDN的年龄几乎差不多。随着时间的推移,MFC技术渐渐的偏离了开发主流,若干年之后的今天,当我们面对着微软的这个经典之笔,内心充满着敬意,那些曾经的记忆,可以说代表着二十年前曾经的辉煌……
        向经典致敬,或许是老一代程序员内心里面难以释怀的感受。互联网大行其道的今天,我们期待着MFC技术能够恢复其曾经的辉煌,或许这个期待会永远成为一种“梦想”,或许一切皆有可能……
        我们希望这个版块可以很好的适配Web时代,期待更好的互联网技术能够使得MFC技术框架得以重现活力,……

试试用AI创作助手写篇文章吧