怎么会没有这头文件的,急!!!

deaky 2005-08-10 03:11:51
有一个C文件
里面#include了一些头文件,但系统找不到这些头件,要怎么做才行
以下是系统里没有的头文件

#include <unistd.h>

#include <arpa/inet.h>
#include <netinet/in.h>

#include <sys/time.h>

#include <sys/socket.h>
怎么样才能在Windows里编译成功
...全文
4520 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
hongfeeling 2005-08-15
  • 打赏
  • 举报
回复
上面的说的对.
楼主如果是学习的话.
装个UNIX玩玩.
Cybergate 2005-08-12
  • 打赏
  • 举报
回复
mingw不提供fork等关键函数。会出大问题。简易楼主安装cygwin或者sfu。尤其是sfu,做得非常好。
robothn 2005-08-10
  • 打赏
  • 举报
回复
http://www.codeproject.com/useritems/cppfaq25apr8jun.asp#q207

/* * This file is part of the Mingw32 package.
* * unistd.h maps (roughly) to io.h */

#ifndef _UNISTD_H

#define _UNISTD_H
#include <IO.H>
#include <PROCESS.H>

#endif /* _UNISTD_H */


Just Save it as Unistd.h and Include in your project

xiaocai0001 2005-08-10
  • 打赏
  • 举报
回复
呵呵!Linux/Unix下的源程序想原封不动的拿到Windows下编译通过?----除非你没用它的系统库。
newbiestar 2005-08-10
  • 打赏
  • 举报
回复
Windows下面本来就没有这些东西,unistd的意思是Unix Standard的意思,里面定义的宏一类的东西都是为了Unix标准服务的(一般来说包括了POSIX的一些常量……)

其他的就更不要说了……

69,375

社区成员

发帖
与我相关
我的任务
社区描述
C语言相关问题讨论
社区管理员
  • C语言
  • 花神庙码农
  • 架构师李肯
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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