在 Win10 的 CMake 中找不到

Mon*_*lal 2 c fseek cmake unistd.h cmake-gui

我正在为 renderdoc 使用 CMake GUI,我收到了这些消息。我应该如何修复它们?

The C compiler identification is MSVC 19.0.24215.1
Check for working C compiler: D:/VS15/VC/bin/x86_amd64/cl.exe
Check for working C compiler: D:/VS15/VC/bin/x86_amd64/cl.exe -- works
Detecting C compiler ABI info
Detecting C compiler ABI info - done
Looking for sys/types.h
Looking for sys/types.h - found
Looking for stdint.h
Looking for stdint.h - found
Looking for stddef.h
Looking for stddef.h - found
Check size of off64_t
Check size of off64_t - failed
Looking for fseeko
Looking for fseeko - not found
Looking for unistd.h
Looking for unistd.h - not found
Configuring done
Run Code Online (Sandbox Code Playgroud)

Ind*_*oad 5

您没有说 CMake 命令是什么,但看起来您正在为 Visual Studio 构建进行配置。它似乎也有效,它只是告诉您它在系统上做了什么和没有找到什么,这是任何配置过程(自动工具或 CMake)的正常部分。

Visual C++ 不提供unistd.h,您可能需要包含其他头文件,但这取决于您的需要。至于off64_t,那是 POSIX 类型,同样,它不是由编译器提供的。

您的代码是否真的需要这些头文件或类型,还是会编译?如果代码不使用标头或类型,则在配置时找不到它们也没关系。

如果失败,您要么需要提供自己所需的实现,修改源代码以使其更具可移植性,要么切换到 GCC 和 mingw 或其他一些提供这些东西的工具链。