CAsyncocket的error C2146: syntax error : missing ';' before identifier '

离草 2011-07-25 05:00:02
在进行CAsyncocket编程中,遇到了如下问题:
问题代码是:
class CClientDlg : public CDialog
{
***********
public:
MySocket m_clientSocket;
*************
}
其中,MySocket 是新建的基于CAsyncocket的一个类,在CClientDlg.h中添加了头文件#include "MySocket.h"。


最终编译出错:
1>d:\clientdlg.h(38) : error C2146: syntax error : missing ';' before identifier 'm_clientSocket'
1>d:\clientdlg.h(38) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
1>d:\clientdlg.h(38) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

...全文
145 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jimmy_Xia 2011-07-25
  • 打赏
  • 举报
回复
***********
这些星号是干嘛用的???
离草 2011-07-25
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 stjay 的回复:]
试试清理,rebuild
[/Quote]

这个肯定试过了呀
离草 2011-07-25
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 buyong 的回复:]
你的分号是不是写成中文的了
[/Quote]

不行,这应该不是问题的症结
stjay 2011-07-25
  • 打赏
  • 举报
回复
试试清理,rebuild
buyong 2011-07-25
  • 打赏
  • 举报
回复
你的分号是不是写成中文的了
Eleven 2011-07-25
  • 打赏
  • 举报
回复
你的MySocket类的头文件是MySocket.h吗?
shenyi0106 2011-07-25
  • 打赏
  • 举报
回复
1.你的MySocket.h头文件中是否少了个';'号?
2.检查你
***********
public:
MySocket m_clientSocket;
*************
上面的代码,看看可有错误

18,356

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 网络编程
c++c语言开发语言 技术论坛(原bbs)
社区管理员
  • 网络编程
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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