'internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:190: MapViewOfFileEx: Attempt to access invalid address

internal error in mingw32_gt_pch_use_address, at config/i386/host-mingw32.c:190: MapViewOfFileEx: Attempt to access invalid address.

I get this error while compiling a c++ program in sublime-text 3.

How to resolve this error?



Solution 1:[1]

In my case, this problem is due to #include<bits/stdc++.h>. Comment this line and get #include <iostream> to solve the problem.

If you have precompiled <stdc++.h> then you have stdc++.h.gch file in this path (path could be different on basis of where you installed MinGW and version) :

C:\MinGW\lib\gcc\mingw32\9.2.0\include\c++\mingw32\bits

So to solve this problem delete stdc++.h.gch file and paste these two commands in your terminal :

  1. Go to the path having your precompiled header in command line

cd C:\MinGW\lib\gcc\mingw32\9.2.0\include\c++\mingw32\bits

  1. Precompile header (mine version is c++17)

g++ -std=c++17 stdc++.h

I have found this solution on a codechef discussion and it works for me.

Solution 2:[2]

I got this problem after installing CodeBlocks, maybe it is because of codeblocks MINGW settings. My initial MinGW is from DEV-C++.

So what I did is this.

1.Delete "C:\...\GnuWin" from PATH.

2.Ensure that you have your old path to your compiler. In my case it was "C:\...\DevCPP\Mingw\bin"

Solution 3:[3]

For me, this error popped up right after I updated my SublimeText application to the latest version, so just restarting the system worked for me!

Solution 4:[4]

I'm not sure what caused this problem today, but I have seen it a few times before.

For me, a full clean and recompile solves it.

Solution 5:[5]

I got this same problem after pre-compiling the stdc++.h file, to get rid of this error, I removed the compiled version of this header that is stdc++.gch.


File path of stdc++.h and stdc++.gch is


C:\Users\UserName\Downloads\MinGW\include\c++\9.2.0\x86_64-w64-mingw32\bits

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 SuperPuperMegaUltraEpicHacker
Solution 3 Dev Sebastian
Solution 4 Doug
Solution 5 Hemang Kinra