[Mingw-users] "Procedure Entry Point CloseHandle could not be located" error with program compiled using MinGW

Back to archive index
Tamir Evan tamir****@gmail*****
Mon Apr 13 12:16:08 JST 2020


On Sun, Apr 12, 2020 at 11:54 PM Ben Clapp <ibenr****@gmail*****> wrote:
>
> Hi all, I have a 3D program using SDL2 and Vulkan that I've developed on
> Linux, but also cross-compile for Windows.
> I have cross-compiled the application and run the application on Windows
> in the past without issue.
>
> Recently, however, I get the following error when running the
> application on Windows:
> "The procedure entry point CloseHandle could not be located in the
> dynamic link library [name_of_program].exe"
> It's not clear to me what changed to cause this error to occur.
> Testing older versions of the software that were working at the time
> result in the same error-

As you seem to have a Windows machine for running the application,
have you tried building your program natively under MinGW/MSYS?

> Debian Linux recently updated their MinGW packaging in their testing
> branch (around late March 2020), so this could be related to the issue
> (I'm developing on a Debian Linux system that is tracking the testing
> branch).

The MinGW packages provided by Debian are from the Mingw-w64
project. You might have more success asking on the Mingw-w64 project
mailing list. This is the mailing list for the MinGW[.org] project.

> libgcc and libstdc++ are statically linked to the application;
> dynamically linking them only changes the error about the entry point
> from CloseHandle to _Unwind_Resume or _ZNSt6chrono3_V212system_clock3nowEv.
>
> As my code does not call CloseHandle() directly, I am confused as to
> what the issue is or what I need to do to resolve the issue.
> It seems as if when the application is being linked by the linker, it is
> somehow referring to CloseHandle() as a func that should be defined
> within the .exe program binary, as opposed to trying to look for
> CloseHandle() inside kernel32.dll.
>
> Can someone give some insight as to what exactly is going on here, and
> what steps can be taken to troubleshoot and resolve the issue?

Based on looking up the error message and the function names you
mention with Google, my guess would be that you've got a mismatch
between the version of libstdc++ (or libgcc) used by your main
application and the version used by one of the libraries (SDL2 or
Vulkan) you link to.

Without access to the source code (or a minimal example that
reproduces the error), or more information about how the application
was linked, packaged and installed, that's the best I can offer.

-- 
Tamir Evan.



More information about the MinGW-Users mailing list
Back to archive index