question

FranciscoMartinez-2647 avatar image
0 Votes"
FranciscoMartinez-2647 asked FranciscoMartinez-2647 commented

"exited with code -1073741701" when executing a C program built in VS2019 with libpq and OpenSSL libraries

Hi all,


I have written a program in C using VisualStudio 2019. This programs connects to a PostGreSQL DB by means of libpq libraries.

All the needed libraries and DLLs are installed and included in the PATH.

However, the execution of the program crashes.

When I try to debug it from VS2019 I got this error:


myprogram.exe (process 5456) exited with code -1073741701.


In the VS2019 output window I can see these messages:


'myprogram.exe' (Win32): Loaded 'C:\Windows\System32\libssl-1_1-x64.dll'.
'myprogram.exe' (Win32): Loaded 'C:\Windows\System32\libcrypto-1_1-x64.dll'.
'myprogram.exe' (Win32): Loaded 'C:\Windows\System32\libintl-8.dll'.
'myprogram.exe' (Win32): Unloaded 'C:\Windows\System32\libintl-8.dll'
'myprogram.exe' (Win32): Loaded 'C:\Windows\System32\libintl-8.dll'.
'myprogram.exe' (Win32): Unloaded 'C:\Windows\System32\libintl-8.dll'

The thread 0x754 has exited with code -1073741701 (0xc000007b).
The thread 0x3a00 has exited with code -1073741701 (0xc000007b).
The program '[5456] myprogram.exe' has exited with code -1073741701 (0xc000007b).


I have double checked that libintl-8.dll is present in C:\Windows\System32\, and also reinstalled it with no results.


I would appreciate very much any help on this.


Thanks and Regards

c++vs-debugging
· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @FranciscoMartinez-2647, please try to download the 32bit PostgreSQL Binaries(win x86-32), then copy them into System32 folder or directly set bin folder to system path environment variables.

1 Vote 1 ·

Hi, thank you for your response. I downloaded the PostGres 32bit version and reinstalled it from scratch with no luck.

0 Votes 0 ·
RLWA32-6355 avatar image RLWA32-6355 FranciscoMartinez-2647 ·

@FranciscoMartinez-2647 Please advise what version of Windows you are using and whether it is a 32-bit version or a 64-bit version. I had assumed you were using a 64-bit version because the debugger messages for dll loading indicated that certain dlls in the question had the "-x64" in their names.

1 Vote 1 ·
Show more comments

1 Answer

RLWA32-6355 avatar image
0 Votes"
RLWA32-6355 answered FranciscoMartinez-2647 commented

It appears to me that "myprogram.exe" is a 64-bit application. My best guess is that the version of libintl-8.dll that is installed in the System32 folder is actually a 32-bit dll. That would be why that dll is loaded and then unloaded with myprogram.exe failing to start and exiting immediately with the 0xC000007b error code.

You can verify the bitness of libintl-8.dll with the dumpbin utility.
Run the command dumpbin /headers on the libintl-8.dll that is installed. The output will show whether the version you have installed is a 64-bit dll or a 32-bit dll.

· 6
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

As an example the following show the results of running dumpbin /headers on a 32-bit dll and a 64-bit dll. The bitness is indicated at the very start of the dumpbin output in the FILE HEADERS section which will indicate either x86 or x64.

32-bit dll
37685-db32.png


64-bit dll
37711-db64.png


1 Vote 1 ·
db32.png (26.1 KiB)
db64.png (26.8 KiB)

Hi, thank you for your response.
You are right, myprogram.exe is a 64-bit application, and libintl-8.dll is a 32-bit DLL.
Unfortunately, there is no 64-bit version of this DLL.
However, I've deleted PostGres and OpenSSL and reinstalled them from scratch in 32-bit version, but the problem still remains.

0 Votes 0 ·
RLWA32-6355 avatar image RLWA32-6355 FranciscoMartinez-2647 ·

Did you remember to change the settings in your project to do a 32-bit build of myprogram.exe?

1 Vote 1 ·
Show more comments