From: Stefan T. Peters <stefan@electroniczombie.com>
To: pgsql-interfaces@postgresql.org
Subject: libpq won't connect when client is built with MinGW
Date: Fri, 21 Oct 2005 12:37:40 -0700
Message-ID: <43594384.8040501@electroniczombie.com> (raw)
Hello, I've been trying to get a simple test program built on Windows XP
Pro SP2 using MinGW 4.1.0 + MSYS 1.0.10. I am using the standard
"postgresql-8.0.4.zip" download with the development libs selected
during install.
Everything builds nicely, but whenever I try to do a PQconnectdb with an
IP address (hostaddr=10.0.0.23), I get the following from PQerrorMessage:
--
could not create socket: The requested service provider could not be
loaded or initialized.
(0x0000277A/10106)
--
And when I try it with a host name (host=testdb), I get the following
from PQerrorMessage:
--
could not translate host name "testdb2" to address: Unknown host
--
BTW, the computer can resolve testdb2 to 10.0.0.23 just fine... Any ideas?
Here is the output of my build script (as created by Eclipse 3.1 + CDT 3.0):
--
**** Full rebuild of configuration Debug for project HelloWorld ****
make -k clean all
rm -rf ./main.o ./main.d HelloWorld.exe
Building file: ../main.cpp
Invoking: GCC C++ Compiler
g++ -IC:\Program Files\PostgreSQL\8.0\include -O0 -g3 -Wall -c
-fmessage-length=0 -omain.o ../main.cpp
Finished building: ../main.cpp
Building target: HelloWorld.exe
Invoking: GCC C++ Linker
g++ -LC:\Program Files\PostgreSQL\8.0\lib -oHelloWorld.exe ./main.o -lpq
Finished building target: HelloWorld.exe
Build complete for project HelloWorld
--
Stefan T. Peters
Attachments:
[text/x-vcard] stefan.vcf (161B, ../43594384.8040501@electroniczombie.com/2-stefan.vcf)
download | inline:
begin:vcard
fn:Stefan T. Peters
n:Peters;Stefan
email;internet:stefan@electroniczombie.com
tel;work:(800) 614.5375 #711
x-mozilla-html:TRUE
version:2.1
end:vcard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: stefan@electroniczombie.com
Subject: Re: libpq won't connect when client is built with MinGW
In-Reply-To: <43594384.8040501@electroniczombie.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox