简体   繁体   English

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

[英]Why does the C++ compiler look in “c:\program files\gnu emacs\include” for include files?

I'm trying to compile curl from source (the zip file) in Windows 10 in order to get the curl library (which in turn is needed to build osgEarth ). 我正在尝试从Windows 10中的源代码 (zip文件)编译curl以获取curl库(反过来,构建库osgEarth则需要使用curl库)。 However, when I have used CMake to generated the Visual Studio projects and I try to compile the ALL_BUILD project using the "default native compiler" (according to CMake), I'm getting a lot of errors, of which the first error says 但是,当我使用CMake生成Visual Studio项目并尝试使用“默认本机编译器”(根据CMake)编译ALL_BUILD项目时,我遇到了很多错误,其中第一个错误是

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

Why does the compiler read c:\\program files\\gnu emacs\\include\\zconf.h ? 为什么编译器读取c:\\program files\\gnu emacs\\include\\zconf.h

To me, it doesn't make any sense that it searches c:\\program files\\gnu emacs\\include for include files, since the compilation should be independent of whether emacs is installed (and if it hadn't been installed, this file wouldn't exist). 对我来说,它在c:\\program files\\gnu emacs\\include搜索包含文件没有任何意义,因为编译应独立于是否已安装emacs(如果尚未安装,则此文件将独立于此文件)将不存在)。 I have searched through all environment variables to se if any of them could be telling the compiler to look in c:\\program files\\gnu emacs\\include for include files, but the only environment variables the term emacs exists in (case insensitive search) is PATH and ORIGINAL_PATH (which I don't know what it does). 我已经搜索了所有环境变量,以确保它们中的任何一个都可以告诉编译器在c:\\program files\\gnu emacs\\include查找包含文件,但是emacs术语存在的唯一环境变量(不区分大小写的搜索)是PATHORIGINAL_PATH (我不知道它的作用)。

Is it perhaps something in the CMake project that makes the compiler search this folder? 也许是CMake项目中的某个东西使编译器搜索此文件夹?

CMake tries to locate your local zlib install path. CMake尝试找到您的本地zlib安装路径。 There are different possible locations, for more details check FindZLIB.cmake somehwere in your cmake install path. 有可能的不同位置,有关更多详细信息,请在cmake安装路径中查找FindZLIB.cmake somehwere。 My local version will search in $ZLIB_ROOT or some windows registry key, maybe one of these variables have been set on your system when installing emacs. 我的本地版本将在$ZLIB_ROOT或某些Windows注册表项中搜索,也许在安装emacs时已在系统上设置了这些变量之一。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM