c++ - 为什么 C++ 编译器会在 "c:\program files\gnu emacs\include"中查找包含文件?

标签 c++ compiler-errors cmake libcurl include-path

我正在尝试从 source 编译 curl (zip 文件)在 Windows 10 中以获取 curl 库(构建 osgEarth 需要它)。但是,当我使用 CMake 生成 Visual Studio 项目并尝试编译 ALL_BUILD使用“默认 native 编译器”(根据 CMake)的项目,我遇到了很多错误,其中第一个错误说

c:\program files\gnu emacs\include\zconf.h(475): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory

为什么编译器会读取 c:\program files\gnu emacs\include\zconf.h ?

对我来说,搜索 c:\program files\gnu emacs\include 没有任何意义对于包含文件,因为编译应该与是否安装了 emacs 无关(如果没有安装,则该文件将不存在)。我已经搜索了所有环境变量,以确定是否有任何一个可以告诉编译器查看 c:\program files\gnu emacs\include对于包含文件,但唯一的环境变量是术语 emacs存在于(不区分大小写的搜索)是 PATHORIGINAL_PATH (我不知道它做了什么)。

是否可能是 CMake 项目中的某些内容使编译器搜索此文件夹?

最佳答案

CMake 尝试找到您的本地 zlib 安装路径。有不同的可能位置,更多详情请查看FindZLIB.cmake somehwe 在您的 cmake 安装路径中。我的本地版本将在 $ZLIB_ROOT 中搜索或某些 Windows 注册表项,可能在安装 emacs 时已在您的系统上设置了这些变量之一。

关于c++ - 为什么 C++ 编译器会在 "c:\program files\gnu emacs\include"中查找包含文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51723297/

相关文章:

c++ - 如何通过参数仿函数参数重载函数切换

c# - 在IQueryProvider的实现中构造Linq.EnumerableQuery时出现编译器错误

cmake - 简单的 find_package 配置文件示例

c++ - 我如何在 C++ 中使用 errno

c++ - 什么是数组到指针衰减?

c++ - 编写此类程序的最佳方法 "writing the code "::Qt

c++ - 隐式转换产生 "error: taking address of temporary"(GCC vs clang)

c++ - 为什么会出现此错误?

c++ - 体系结构错误的 undefined symbol

c++ - 在 Boost.Test 和现代 CMake 中使用多个测试文件