visual-studio-2015 - unistd.h - 编译失败
问题描述
我在 VS 2015 和 Windows 10 中使用 Flex。我无法编译程序,出现以下错误:
cannot open source file "unistd.h"
Cannot open include file: 'unistd.h': No such file or directory
Here is the code section OF lex.yy.c file which this error relates to:
#ifndef YY_NO_UNISTD_H
/* Special case for "unistd.h", since it is non-ANSI. We include it way
* down here because we want the user's section 1 to have been scanned first.
* The user has a chance to override it with an option.
*/
#include <unistd.h>
#endif
我已经尝试了来自相同帖子的所有建议以寻求帮助。
当我添加 时%option nounistd
,此错误消失,但随后出现另外两个错误:
Warning C4013 'isatty' undefined; assuming extern returning int
Severity Code Description Project File Line Suppression State
Error C4996 'fileno': The POSIX name for this item is deprecated. Instead, use the ISO C and C++ conformant name: _fileno. See online help for details.
我只是无奈。
解决方案
推荐阅读
- javascript - 在 javascript 函数中使用数据库值填充 jsp 下拉列表
- unity3d - Unity 2d 中的奇怪碰撞错误
- c++ - 以下函数来自`_GLOBAL__sub_I_a()`和`__static_initialization_and_destruction_O()`
- flutter - 将字符串写入文本文件时出错
- kubernetes - Python 执行 kompose 命令和 kubectl 命令
- reactjs - 在 reactjs 中捕获组件的最后更新
- java - 在类数组中查找特定变量
- pytest - 如何生成带有屏幕截图的 HTML 报告
- c++ - (C++) 有什么理由不使用打开的文件吗?
- python - 我试图在我的基于 pygame 的游戏中添加简单的碰撞,但它不起作用