Skip site navigation (1) Skip section navigation (2)

libpq won't connect when client is built with MinGW

From: "Stefan T(dot) Peters" <stefan(at)electroniczombie(dot)com>
To: pgsql-interfaces(at)postgresql(dot)org
Subject: libpq won't connect when client is built with MinGW
Date: 2005-10-21 19:37:40
Message-ID: 43594384.8040501@electroniczombie.com (view raw or flat)
Thread:
Lists: pgsql-interfaces
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


Attachment: stefan.vcf
Description: text/x-vcard (163 bytes)

pgsql-interfaces by date

Next:From: Stefan T. PetersDate: 2005-10-21 20:28:11
Subject: Re: libpq won't connect when client is built with MinGW
Previous:From: Jochen KokemüllerDate: 2005-10-21 18:46:48
Subject: Reading bytea field

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group