c - 在 Win10 的 CMake 中找不到

标签 c cmake fseek cmake-gui unistd.h

我正在为 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

最佳答案

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

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

您的代码是否真的需要这些 header 或类型,或者它会编译吗?如果代码不使用 header 或类型,那么即使在配置时找不到它们也没关系。

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

关于c - 在 Win10 的 CMake 中找不到,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41154950/

相关文章:

c++ - fgets() 似乎没有正确移动文件指针

c - C 中的 Do-While 循环 - 打印时出错

c++ - findopenssl.cmake 找不到OpenSSL,编译restbed,C++

c - 线程到多搜索文件

c++ - 错误 : ‘hour’ was not declared in this scope

curl - 使用 CMake 的外部项目安装 libcurl4-openssl-dev

是否可以使用 fseek(stdin,1,SEEK_SET) 或 rewind(stdin) 代替不可移植的 fflush(stdin) 来刷新输入缓冲区?

c - 错误 : "Implicit declaration of function..." on all my functions

c - Posix 线程 ID 是否与 linux 线程 ID 具有一对一关系?

c - 如何对十六进制字符串求和