Home > Enterprise >  msys2 g - Entry Point Not Found
msys2 g - Entry Point Not Found

Time:04-12

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.

CodePudding user response:

The problem is a dll conflict with the cygwin1.dll dll. You likely have a dll with the same name as one required by your application in one of the folders of your OS PATH environment variable that is a different version of the required dll or less likely a different dll with the same name.

The conflict could also be in one of the other folders that your OS searches. This MSDN article describes how the Windows OS locates required dlls: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order#search-order-for-desktop-applications

  • Related