mingw / include / c ++ / cstdlib:stdlib.h:没有这样的文件或目录 [英] mingw/include/c++/cstdlib: stdlib.h: No such file or directory
问题描述
我试图为Fedora上的64位Windows交叉编译 OpenImageIO 26使用MinGW。在使用 yum
来检索mingw版本的依赖项后,我运行了 mingw64-cmake
,后面跟着使
。但是,马上就会收到关于 stdlib.h
未找到的编译错误。
<$构建CXX对象src / libutil / CMakeFiles / OpenImageIO_Util.dir / argparse.cpp.obj
构建目标CopyFiles
[0%]在包含在... / oiio中的文件中/src/libutil/argparse.cpp:36:0:
/ usr / x86_64-w64-mingw32 / sys-root / mingw / include / c ++ / cstdlib:75:15:致命错误:stdlib.h:No这样的文件或目录
#include_next< stdlib.h>
^ ~~~~~~~~~
编译终止。
我已经确认 stdlib.h
是至少在 / usr / include /
和 / usr / x86_64-w64-mingw32 / sys-root / mingw / include / c ++ /
给出编译器错误的文件也在这里。
为什么我仍然收到错误 stdlib.h:No这样的文件或目录
?
更新:
我做了额外的研究并了解了以下内容: code>预处理器指令#include_next的行为与#include指令相似,只是它明确排除了包含文件的目录与要搜索指定文件的路径。
这就可以解释为什么 cstdlib
没有找到 stdlib.h
同一文件夹。但是 cstdlib
是MinGW的一部分,而不是我想要编译的代码的任何部分。所以我仍然不知道这里有什么问题或者如何解决这个错误。
编辑:这是编译器版本信息,以防万一有任何用处: https://pastebin.com/PZiXS2fg 。这是一个全新的安装,所以不应该有任何不寻常的事情。解决方案
我解决了它,我可以再次编译。
解决方案(对我而言)添加到变量 CPLUS_INCLUDE_PATH
的路径中,并将其设置为MinGW c ++ include目录,对我来说: C:\MinGW\lib\gcc\mingw32\6.3.0\include\c ++
。
我希望它也适用于您。
I am trying to cross-compile OpenImageIO for 64-bit Windows on Fedora 26 using MinGW. After using yum
to retrieve the mingw versions of the dependencies, I ran mingw64-cmake
followed by make
. However, right away I receive a compile error about stdlib.h
not being found.
[ 0%] Built target CopyFiles
[ 0%] Building CXX object src/libutil/CMakeFiles/OpenImageIO_Util.dir/argparse.cpp.obj
In file included from .../oiio/src/libutil/argparse.cpp:36:0:
/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/cstdlib:75:15: fatal error: stdlib.h: No such file or directory
#include_next <stdlib.h>
^~~~~~~~~~
compilation terminated.
I have confirmed that stdlib.h
is found at least in /usr/include/
and in /usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/
where the file giving the compiler error also is located.
Why do I still receive the error stdlib.h: No such file or directory
?
Update:
I did additional research and learned the following: The preprocessor directive #include_next behaves like the #include directive, except that it specifically excludes the directory of the including file from the paths to be searched for the named file.
This would explain why cstdlib
does not find stdlib.h
from the same folder. But cstdlib
is part of MinGW and not any part of the code I am trying to compile. So I still have no idea what is wrong here or how to fix this error.
Edit: Here is the compiler version info in case it is of any use: https://pastebin.com/PZiXS2fg. This is a fresh install so there shouldn't be anything unusual there, though.
I solved it, i can compile again.
The solution (for me) is add to path the variable CPLUS_INCLUDE_PATH
and set it to the MinGW c++ include directory, for me: C:\MinGW\lib\gcc\mingw32\6.3.0\include\c++
.
I hope it works for you too.
这篇关于mingw / include / c ++ / cstdlib:stdlib.h:没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!