pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Finn Kettner <fk@akf.dk>
To: pgsql-interfaces@postgresql.org
To: pgsql-hacker@postgresql.org
Subject: libpq static link library dowsn't work (M$ VS6)
Date: Wed, 27 Sep 2000 01:25:01 +0100
Message-ID: <200009270034.e8R0YDN66620@hub.org> (raw)

Hello again.

I'm in the process of making a COM wrapper (enabling VB to connect 
to PostGres) for the libpq library using Visual Studio 6.0 Pro, but 
have a few problems. I can make use of the libpq.dll library from the 
COM wrapper, but I thought that it might be a bit better if the 
actual library routines was included in the COM wrapper, and thus 
making the libpq.dll unnedded.

But if I include all the files that make up the library, then I can't 
get a connection. I even tried to make a small test file which works 
ok when using the dll, but doesn't when I include the actual .c files 
which make up the dll and static link library (.lib). Linking with 
the static link library that comes with the dll file doesn't work 
either. This little program is what I've used. Has anybody succedded 
in lnking an application with the static link library (libpq.lib) and 
actually getting a working application??? If so then I'm very 
interested in getting any help.

-------- test file ---------- test file -----------

#include <iostream.h>
#include "libpq-fe.h"

int main (int argc, char* argv[])
{
   PGconn *conn;

   cout << "Hello pgsql world!!!" << endl;
   cout << "Connecting to the database." << endl;
   conn = PQconnectdb("host=host.name user=root");
   if (PQstatus(conn) == CONNECTION_BAD) {
      cout << "Boohoo, the connection failed!!!" << endl;
      cout << "Value is " << (long) conn << endl;
   } else {
      cout << "Hurray, we got connected." << endl;
      PQfinish(conn);
   }
   return 0;
}

-------- test file ---------- test file -----------

Yours faithfully.
Finn Kettner.
PS. I have also created a project file for the psql application, if 
this has any interest it might as well be included in the furture 
distributions of postgresql. The dll and static link library is also 
more or less finished, but as I can't link with the static link 
library I don't think that it has much interest untill the problem is 
solved.



Message-ID: <200009270034.e8R0YDN66620@hub.org>
Permalink:  ../200009270034.e8R0YDN66620@hub.org/
Also on:    postgresql.org/message-id/200009270034.e8R0YDN66620@hub.org

 · 

reply

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: fk@akf.dk, pgsql-hacker@postgresql.org
  Subject: Re: libpq static link library dowsn't work (M$ VS6)
  In-Reply-To: <200009270034.e8R0YDN66620@hub.org>

* 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