Re: connecting using libpq breaks printf

From: Joey Morris <rjmorris12(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: connecting using libpq breaks printf
Date: 2009-02-18 18:29:53
Message-ID: 20090218182953.GD23731@conquistador.dnsalias.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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!

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2009-02-18 18:37:08 Re: Query palns and tug-of-war with enable_sort
Previous Message Mikko Partio 2009-02-18 18:06:25 Re: connecting using libpq breaks printf