Re: connecting using libpq breaks printf - Mailing list pgsql-general

From Joey Morris
Subject Re: connecting using libpq breaks printf
Date
Msg-id 20090218182953.GD23731@conquistador.dnsalias.org
Whole thread Raw
In response to Re: connecting using libpq breaks printf  (Aurimas Černius <aurisc4@gmail.com>)
List pgsql-general
> How do you run the program, in console or by double clicking on
> executable. Try the second. Does the console window apear on the screen?

Aha! This tip has led to the solution. I had been running the program from
an emacs shell buffer. If I run it from the Windows console or by
double-clicking the executable, a dialog box pops up with this error
message:

"The application has failed to start because LIBPQ.dll was not found.
Re-installing the application may fix this problem."

At run-time, the system apparently cannot find libpq.dll and is aborting
immediately. The reason is that the directory containing libpq.dll was not
in my DLL search path. I added C:\Program Files\PostgreSQL\8.3\bin to my
PATH environment variable, and now the program works as expected. Note that
adding C:\Program Files\PostgreSQL\8.3\lib to the PATH doesn't completely
solve the problem, since bin contains some necessary DLLs that aren't in lib
(such as ssleay32.dll).

Alternatively, I could have copied the DLLs to C:\Windows\system32 or to the
directory containing the executable, but I like the PATH solution better.

Thanks, everyone, for your help!

pgsql-general by date:

Previous
From: Mikko Partio
Date:
Subject: Re: connecting using libpq breaks printf
Next
From: Tom Lane
Date:
Subject: Re: Query palns and tug-of-war with enable_sort