Quantcast
Channel: Active questions tagged windows-subsystem-for-linux - Ask Ubuntu
Viewing all articles
Browse latest Browse all 2930

Broken compiler: fatal error: _mingw.h: No such file or directory

$
0
0

I have broken my compilation and not sure if it is possible to fix it without reinstalling everything from scratch.

I cannot compile the simplest program:

#include "math.h"int main(){    return 0;}

It compiles on my backup version, of course, but I am trying to avoid having to revert to the working version, as I have installed a lot things since then... and apparently broke something in the process.

From the error, it seems that compiler is trying to use _mingw.h header. Why? I am not using MinGW. I am using the same compiler that works without issues in my backup version (I have even tried to install another version of g++ from apt-get to confirm that changing compiler does not help.) The error message:

 In file included from /usr/local/include/crtdefs.h:10:0,                  from /usr/local/include/sys/cdefs.h:7,                  from /usr/include/features.h:424,                  from /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h:39,                  from /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h:533,                  from /usr/include/c++/7/cmath:41,                  from /usr/include/c++/7/math.h:36,                  from /mnt/c/test/main.cpp:1: /usr/local/include/corecrt.h:10:10: fatal error: _mingw.h: No such file or directory  #include <_mingw.h>           ^~~~~~~~~~ compilation terminated.

I know that _mingw.h file does not exist. That is not the issue. The issue that g++ even requires it: on my backup version this header also does not exist and is not included.

Output from g++ -M main.cpp on the backup version (note how it includes /usr/include/x86_64-linux-gnu/sys/cdefs.h and not /usr/local/include/sys/cdefs.h like the broken version).

main.o: /mnt/c/test/main.cpp /usr/include/stdc-predef.h \ /usr/include/c++/7/math.h /usr/include/c++/7/cmath \ /usr/include/x86_64-linux-gnu/c++/7/bits/c++config.h \ /usr/include/x86_64-linux-gnu/c++/7/bits/os_defines.h \ /usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \ /usr/include/x86_64-linux-gnu/bits/wordsize.h \ /usr/include/x86_64-linux-gnu/bits/long-double.h \ /usr/include/x86_64-linux-gnu/gnu/stubs.h \ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \ /usr/include/x86_64-linux-gnu/c++/7/bits/cpu_defines.h \ /usr/include/c++/7/bits/cpp_type_traits.h \ /usr/include/c++/7/ext/type_traits.h /usr/include/math.h \ /usr/include/x86_64-linux-gnu/bits/libc-header-start.h \ /usr/include/x86_64-linux-gnu/bits/types.h \ /usr/include/x86_64-linux-gnu/bits/typesizes.h \ /usr/include/x86_64-linux-gnu/bits/math-vector.h \ /usr/include/x86_64-linux-gnu/bits/libm-simd-decl-stubs.h \ /usr/include/x86_64-linux-gnu/bits/floatn.h \ /usr/include/x86_64-linux-gnu/bits/floatn-common.h \ /usr/include/x86_64-linux-gnu/bits/flt-eval-method.h \ /usr/include/x86_64-linux-gnu/bits/fp-logb.h \ /usr/include/x86_64-linux-gnu/bits/fp-fast.h \ /usr/include/x86_64-linux-gnu/bits/mathcalls-helper-functions.h \ /usr/include/x86_64-linux-gnu/bits/mathcalls.h \ /usr/include/x86_64-linux-gnu/bits/iscanonical.h \ /usr/include/c++/7/bits/std_abs.h /usr/include/stdlib.h \ /usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h \ /usr/include/x86_64-linux-gnu/bits/waitflags.h \ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \ /usr/include/x86_64-linux-gnu/bits/types/locale_t.h \ /usr/include/x86_64-linux-gnu/bits/types/__locale_t.h \ /usr/include/x86_64-linux-gnu/sys/types.h \ /usr/include/x86_64-linux-gnu/bits/types/clock_t.h \ /usr/include/x86_64-linux-gnu/bits/types/clockid_t.h \ /usr/include/x86_64-linux-gnu/bits/types/time_t.h \ /usr/include/x86_64-linux-gnu/bits/types/timer_t.h \ /usr/include/x86_64-linux-gnu/bits/stdint-intn.h /usr/include/endian.h \ /usr/include/x86_64-linux-gnu/bits/endian.h \ /usr/include/x86_64-linux-gnu/bits/byteswap.h \ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \ /usr/include/x86_64-linux-gnu/bits/uintn-identity.h \ /usr/include/x86_64-linux-gnu/sys/select.h \ /usr/include/x86_64-linux-gnu/bits/select.h \ /usr/include/x86_64-linux-gnu/bits/types/sigset_t.h \ /usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h \ /usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h \ /usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h \ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \ /usr/include/x86_64-linux-gnu/bits/sysmacros.h \ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h \ /usr/include/x86_64-linux-gnu/bits/thread-shared-types.h \ /usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h \ /usr/include/alloca.h /usr/include/x86_64-linux-gnu/bits/stdlib-float.h

I am on WSL2 if that matters to the issue. I do not have any *mingw* packages listed in dpkg --list.


Viewing all articles
Browse latest Browse all 2930

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>