无法编译项目,缺少io.h文件

Pen*_*m10 4 c++ compiler-construction compact-framework include

我无法使用Windows Mobile(基于Windows CE)操作系统编译移动设备的C++项目,Visual Studio中的Visual C++编译器失败:

Error   1   fatal error C1083: Cannot open include file: 'io.h'
Run Code Online (Sandbox Code Playgroud)

编辑
我正在尝试编译SQLite合并,shell.c文件包含对此io.h的调用,但文件中缺少io.h.

我用谷歌搜索,我找不到如何得到这个.h文件.

有人能指出我正确的方向吗?

mlo*_*kot 8

io.h文件不适用于Windows Mobile等基于Windows CE的系统的SDK.事实上,io.h标题从未成为ISO C和C++标准的一部分.它定义了在Windows NT上属于POSIX兼容层的功能,但不是Windows CE.

由于Windows CE上缺少POSIX功能,我开发了一个小型实用程序库WCELIBCEX.它确实包含io.h,它是一个非常小的版本,对于SQLite来说可能不够.但是,正如ctacke所提到的,你应该使用SQLite端口用于Windows CE,因为SQLite的原始版本不能为这个平台编译.

ps注意,您的问题没有明确指出您正在为Windows Mobile构建.如果没有发现标签中提到的.NET Compact Framework,那么整个问题就不明确了.


小智 5

看起来 io.h 是标准 VS 的一部分,但可能不是 WINCE 版本的一部分(如果有的话)。从您的 dir /s 看起来您没有它。

我查看了 shell.c,它不包含用于 wince 的 io.h:

#if defined(_WIN32) || defined(WIN32)
# include <io.h>
#define isatty(h) _isatty(h)
#define access(f,m) _access((f),(m))
#else
/* Make sure isatty() has a prototype.
*/
extern int isatty();
#endif

#if defined(_WIN32_WCE)
/* Windows CE (arm-wince-mingw32ce-gcc) does not provide isatty()
 * thus we always assume that we have a console. That can be
 * overridden with the -batch command line option.
 */
#define isatty(x) 1
#endif
Run Code Online (Sandbox Code Playgroud)

您可能正在使用定义的错误宏进行编译。