我想使用MinGW的在Fedora 26的交叉编译OpenImageIO 64位Windows。在使用yum
来检索相关性的mingw版本后,我跑mingw64-cmake
,然后make
。但是,我马上收到一个关于stdlib.h
未找到的编译错误。的MinGW /包括/ C++/cstdlib:stdlib.h中:没有这样的文件或目录
[ 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.
我已经证实,stdlib.h
发现至少/usr/include/
和/usr/x86_64-w64-mingw32/sys-root/mingw/include/c++/
这里给编译器错误也是文件的位置。
为什么我仍然收到错误stdlib.h: No such file or directory
?
更新: 我做更多的研究和学习了以下内容: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.
这可以解释为什么cstdlib
没有找到相同的文件夹stdlib.h
。但cstdlib
是MinGW的一部分,而不是我正在编译的代码的任何部分。所以我仍然不知道这里出了什么问题或者如何解决这个错误。
编辑:以下是编译器版本信息,以备任何用途时使用:https://pastebin.com/PZiXS2fg。这是一个全新的安装,所以在那里不应该有任何异常。
出于好奇,这'G ++'版本包含在你的'mingw64'? – TriskalJM
@TriskalJM gcc版本7.1.0 20170502(Fedora的MinGW的7.1.0-1.fc26) – Steve
是不是有你'在/ usr/x86_64的-W64-的mingw32/SYS-根/ MinGW的一个'stdlib.h' /包括/'哪个可以通过'#include_next'找到? – ssbssa