【问题标题】:Error using include sys/resource.h with Windows 10 C++在 Windows 10 C++ 中使用 include sys/resource.h 时出错
【发布时间】:2020-11-06 07:41:49
【问题描述】:

我在 macOS 上使用 VS 代码已有一段时间并切换到 Windows 10,我尝试从我的 mac 运行代码,但它给了我这个错误,我无法使用 mac。我安装了 LLVM 不确定是否有帮助。

#Include <sys/resource.h>

我的编译器路径当前设置为:

"compilerPath": "C:/Program Files (x86)/Microsoft Visual Studio/2019/Community/VC/Tools/MSVC/14.27.29110/bin/Hostx64/x64/cl.exe",

我可以这样使用常用命令 gcc/g++ 吗?

我是 Windows 新手,不知道如何干净地配置东西。谢谢。

【问题讨论】:

  • 什么错误?也应该是#include,小写。
  • sys/resource.h 可能是 Windows 中不存在的 BSD 东西。

标签: c++ windows visual-studio-code


【解决方案1】:

sys/resource.h 是一个POSIX 头文件,这就是为什么您的系统无法在 Windows 上的任何位置找到它的原因。

如果您仍想使用它,那么您可以使用虚拟机或在您的系统上安装cygwin

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2015-10-31
    • 1970-01-01
    • 2012-09-26
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-09-19
    相关资源
    最近更新 更多