On 09/21/2017 12:10 AM, Steven Penny wrote: > > $ x86_64-w64-mingw32-g++ \ >> -isystem /usr/x86_64-w64-mingw32/sys-root/mingw/include alfa.cpp > In file included from > /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/ext/string_conversions.h:41:0, > > from > /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/bits/basic_string.h:5402, > from /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/string:52, > from /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/stdexcept:39, > from /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/array:39, > from /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/tuple:39, > from /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/functional:55, > from alfa.cpp:2: > /usr/lib/gcc/x86_64-w64-mingw32/6.3.0/include/c++/cstdlib:75:25: fatal > error: >  stdlib.h: No such file or directory > #include_next > > Now really "-I" and "-isystem" are not really needed for this example, > because > that directory gets pulled in already - but it should work even with them > included. Also it is somewhat important that it do work even with the > redundant > options included, because Cmake often dumps those options in with GCC > commands. > I don't really work with cmake, but what it looks like, but it probably makes gcc look in the mingw include dir first and then gcc's, breaking gcc's headers. Unfortunately, I don't have any good ideas besides hacking cmake to remove the -isystem calls, or contacting gcc-help directly.