问题

途中使用的命令是cl.exe,在执行命令的时候找不到对应的unistd.h文件。

unistd.h是Unix系统的文件,因此,十有八九,使用的是Windows系统。下面的代码可以修复,但是如果修复了unistd.h,很大概率你还会有更多个*.h文件找不到。劝退。

解决

找到这个编译器所在的文件夹的include文件夹,并且unistd.h文件复制进去即可。可以新建一个文本文件,把名字和后缀名改为unistd.h。

#ifndef _UNISTD_H

#define _UNISTD_H 1

/* This is intended as a drop-in replacement for unistd.h on Windows.

* Please add functionality as neeeded.

* https://stackoverflow.com/a/826027/1202830

*/

#include

#include

#include /* getopt at: https://gist.github.com/ashelly/7776712 */

#include /* for getpid() and the exec..() family */

#include /* for _getcwd() and _chdir() */

#define srandom srand

#define random rand

/* Values for the second argument to access.

These may be OR'd together. */

#define R_OK 4 /* Test for read permission. */

#define W_OK 2 /* Test for write permission. */

//#define X_OK 1 /* execute permission - unsupported in windows*/

#define F_OK 0 /* Test for existence. */

#define access _access

#define dup2 _dup2

#define execve _execve

#define ftruncate _chsize

#define unlink _unlink

#define fileno _fileno

#define getcwd _getcwd

#define chdir _chdir

#define isatty _isatty

#define lseek _lseek

/* read, write, and close are NOT being #defined here, because while there are file handle specific versions for Windows, they probably don't work for sockets. You need to look at your app and consider whether to call e.g. closesocket(). */

#ifdef _WIN64

#define ssize_t __int64

#else

#define ssize_t long

#endif

#define STDIN_FILENO 0

#define STDOUT_FILENO 1

#define STDERR_FILENO 2

/* should be in some equivalent to */

typedef __int8 int8_t;

typedef __int16 int16_t;

typedef __int32 int32_t;

typedef __int64 int64_t;

typedef unsigned __int8 uint8_t;

typedef unsigned __int16 uint16_t;

typedef unsigned __int32 uint32_t;

typedef unsigned __int64 uint64_t;

#endif /* unistd.h */

Windows的通病

这样是不可行的,在许多情况下。原因是这个头文件是unix, standard的缩写,只有unix系统(Linux, Mac OS)才有。因此我们需要找到对应的Windows标准库,就是 io.h,把包含是unistd.h的地方,都替换成io.h即可。

python安装后无法打开文本_Python 安装zbar-py时出现 无法打开包括文件: “unistd.h” no such file or directory...相关推荐

  1. Python 安装zbar-py时出现 无法打开包括文件: “unistd.h” no such file or directory

    问题 途中使用的命令是cl.exe,在执行命令的时候找不到对应的unistd.h文件. unistd.h是Unix系统的文件,因此,十有八九,使用的是Windows系统.下面的代码可以修复,但是如果修 ...

  2. 成功解决 _mssql.c(568): fatal error C1083: 无法打开包括文件: “sqlfront.h”: No such file or directory

    成功解决 _mssql.c(568): fatal error C1083: 无法打开包括文件: "sqlfront.h": No such file or directory 目 ...

  3. fatal error C1083: 无法打开包括文件:“stdint.h”: No such file or directory

    fatal error C1083: 无法打开包括文件:"stdint.h": No such file or directory [错误]fatal error C1083: 无 ...

  4. VS2019 C++ 编译项目错误:无法打开包括文件:“graphics.h”: No such file or directory

    VS2019 编译一个C++小游戏,导入项目后,发现VS一直提示 "无法打开包括文件:"graphics.h": No such file or directory&qu ...

  5. fatal error C1083: 无法打开包括文件: “afx.h”: No such file or directory

      在用Visual Studio 2017打开一个工程进行编译时,报了如下错误: fatal error C1083: 无法打开包括文件: "afx.h": No such fi ...

  6. 【VC++2010无法debug】fatal error C1083: 无法打开包括文件:“stdio.h”: No such file or directory【问题解决】

    [VC++2010无法debug]fatal error C1083: 无法打开包括文件:"stdio.h": No such file or directory[问题解决] st ...

  7. fatal error C1083: 无法打开包括文件:dxtrans.h: No such file or directory

    From: http://blog.csdn.net/pkueecser/article/details/7287938 fatal error C1083: 无法打开包括文件:"dxtra ...

  8. 无法打开包括文件: “ocl_macros.h”: No such file or directory

    并行处理显示错误: 无法打开包括文件: "ocl_macros.h": No such file or directory 尝试了在项目属性-C/C++-常规中将 '使用Windo ...

  9. 解决 VS 无法打开包括文件: “XXX.h”: No such file or directory问题

    每次封装管理,当 Visual Studio 包含多个 .h 文件和 .c 文件,运行时总会发生如下错误 错误 C1083 无法打开包括文件: "XXX.h": No such f ...

最新文章

  1. 在线作图|在线做扩增子抽平
  2. 白洋组公众号-植物微生组33天受邀原创-诚邀同行分享经验
  3. 学习笔记Spark(七)—— Spark SQL应用(2)—— Spark DataFrame基础操作
  4. [LUOGU] P4342 [IOI1998]Polygon
  5. liferay如何在struts2中調用ajax
  6. 在centos服务器上安装配置私人邮箱,并在web端管理邮件
  7. PyTorch 1.0 中文文档:torchvision.utils
  8. 20171125-第六次例会
  9. 如何在 reducer 之间共享 state?
  10. Oracle 11g 数据恢复 数据误删除后的恢复 0、执行 select log_mode from v$database;查看是否为归档模式 1、确定删除时间和被删除的表 04-23,GR
  11. HCIE-Security心得
  12. utorrent设置上传速度_utorrent下载速度很慢怎么设置?
  13. wps带阴影的边框怎么设置_win7系统下wps阴影边框如何设置
  14. delphi android 音乐播放器,Mcool音乐播放器
  15. android expandablerecycle 动画,Android Expandable RecyclerView不同卡高
  16. angularJs-基础用法
  17. 笔记本电脑亮度无法调节问题
  18. Xilinx FPGA 初探内部时钟管理
  19. 第一集 斗罗世界 第八章
  20. Java break outer和continue outer的用法

热门文章

  1. Centos打开、关闭、结束tomcat,及查看tomcat运行日志
  2. 【软工项目组】第十八次会议
  3. WCF编程系列(六)以编程方式配置终结点
  4. 数据结构-1-顺序表的实现
  5. Android 上千张图片的列表滑动加载
  6. [转载] PYTHON 字符串转换为二进制字符串,二进制字符串转换为字符串
  7. [转载] python中日期和时间格式化输出的方法
  8. 建立时间和保持时间关系详解
  9. I/O接口标准(1):LVTTL、LVCMOS、SSTL、HSTL
  10. ACM字符串处理算法经典:字符串搜索