首页 > 代码库 > 在VC下如何使用头文件unistd.h
在VC下如何使用头文件unistd.h
头文件unistd.h是Linux/Unix的系统调用,包含了许多UNIX系统服务函数原型,如open、read、write、_exit、getpid等函数。在linux下能够编译通过的包含此头文件的程序,在VC下编译时出现了如下问题
fatal error C1083: Cannot open include file: ‘unistd.h‘: No such file or directory
其实解决这个问题的方法并不难,只要在你的默认库文件夹下(我的电脑是D:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\)添加一个unistd.h文件即可,其内容如下:
#ifndef _UNISTD_H
#define _UNISTD_H
#include <io.h> #include <process.h>
#endif /* _UNISTD_H */
这样在重新编译包含unis.h的程序就能通过了
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。