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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…