请问"找不到select.h文件"的问题如何解决?

wswwwt 2009-07-24 05:45:31
在windows 下装了Microsoft Visual Studio 8,需要用到select时要包含进头文件“select.h”,但是找不到这个文件,请问该如何解决?
...全文
475 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wswwwt 2009-07-24
  • 打赏
  • 举报
回复
代码片段
************************************************
timeval tv;
while(1)
{
FD_ZERO(&fdread);
FD_SET(hsocket,&fdread);
tv.tv_sec = 2;
tv.tv_usec = 0;
select(0,&fdread,NULL,NULL,&tv);
if(FD_ISSET(hsocket,&fdread))
{
nRet = recv(hsocket,(LPSTR)dest,sizeof(dest),0);
}
else
{
}
}
****************************************
oyljerry 2009-07-24
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 wswwwt 的回复:]
<winsock2.h>加了的,编译显示的错误为


error C2227: left of '->fd_count' must point to class/struct/union/generic type
        type is ''unknown-type''


error C2227: left of '->fd_array' must point to class/struct/union/generic type
        type is ''unknown-type''

error C2227: left of '->fd_count' must point to class/struct/union/generic type
        type is ''unknown-type''
[/Quote]
具体语句是什么?
alfwolf 2009-07-24
  • 打赏
  • 举报
回复
你能把那段代码贴出来吗?
你fd_set如何用的?
wswwwt 2009-07-24
  • 打赏
  • 举报
回复
可能是自己代码的问题
wswwwt 2009-07-24
  • 打赏
  • 举报
回复
<winsock2.h>加了的,编译显示的错误为


error C2227: left of '->fd_count' must point to class/struct/union/generic type
type is ''unknown-type''


error C2227: left of '->fd_array' must point to class/struct/union/generic type
type is ''unknown-type''

error C2227: left of '->fd_count' must point to class/struct/union/generic type
type is ''unknown-type''
oyljerry 2009-07-24
  • 打赏
  • 举报
回复
没有select.h这个文件,包含 <winsock2.h>
晨星 2009-07-24
  • 打赏
  • 举报
回复
select?socket的那个?应该在<winsock2.h>中吧。

18,357

社区成员

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

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