I installed msys2 and gcc according to this tutorial. However, when I am using the g++.exe in C:\msys64\mingw64\bin\ , I could not run the following program after compilation:
#include <deque>
int main() {
std::deque<int> d;
d.push_back(1);
return 0;
}
with an error of The procedure entry point _ZSt28__throw_bad_array_now_lengthv could not be located in the dynamic link library
. However the following program worked fine:
#include <iostream>
int main() {
std::cout << "hi" << std::endl;
return 0;
}
I also tried using the g++.exe inside C:\msys64\usr\bin, in which case I got an error of
0 [main] cc1plus (8892) C:\msys64\usr\lib\gcc\x86_64-pc-msys\11.2.0\cc1plus.exe: *** fatal error - cygheap base mismatch detected - 0x180349408/0x180347408. This problem is probably due to using incompatible versions of the cygwin DLL. Search for cygwin1.dll using the Windows Start->Find/Search facility and delete all but the most recent version. The most recent version *should* reside in x:\cygwin\bin, where 'x' is the drive on which you have installed the cygwin distribution. Rebooting is also suggested if you are unable to find another cygwin DLL.
which seems really strange. I restarted my computer once and the problem persists. Any help is appreciated in advance.