"Procedure Entry Point CloseHandle could not be located" error with program compiled using MinGW

Ben Clapp <[email protected]> Sun, 12 Apr 2020 15:54:11 -0500
Newsgroups gmane.comp.gnu.mingw.user
Message-ID <[email protected]>
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-
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).

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?

_______________________________________________
MinGW-Users mailing list
[email protected]

This list observes the Etiquette found at
http://www.mingw.org/Mailing_Lists.
We ask that you be polite and do the same.  Disregard for the list etiquette may cause your account to be moderated.

_______________________________________________
You may change your MinGW Account Options or unsubscribe at:
https://lists.osdn.me/mailman/listinfo/mingw-users
Also: mailto:[email protected]?subject=unsubscribe