找不到osx sys/io.h [英] osx sys/io.h not found

查看:582
本文介绍了找不到osx sys/io.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在os x下使用cc编译为linux开发的c程序. 它包含头文件sys/io.h. 编译时出现错误消息,找不到该文件? os x下没有任何sys/io.h头文件吗?

I'd like to compile a c programm developed for linux using cc under os x. It includes the header sys/io.h. When compiling I get the error that this file could not be found? Isn't there any sys/io.h header file under os x?

任何帮助将不胜感激!

谢谢!

推荐答案

改为包含<sys/uio.h>.

或者为什么不两者都用?

or why not both?

#ifdef __APPLE__
        #include <sys/uio.h>
#else
        #include <sys/io.h>
#endif

在Apple OS(OSX/iOS)的情况下,代码将使用<sys/uio.h>

In case of Apple OS (OSX/iOS) the code will know compile with <sys/uio.h>

这篇关于找不到osx sys/io.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆