pg.ddx.io  pgsql-odbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Doug Stade <stade@codefast.com>
To: pgsql-odbc@postgresql.org
Subject: cannot find odbc library to link to for c program
Date: Thu, 16 Mar 2006 11:48:50 -0700
Message-ID: <20060316184850.GD2378@codefast.com> (raw)

   SUMMARY:

   I have written a c program that uses odbc functions, I do not know the
   name of odbc postgres library I need to link to on windows.

   Can someone tell me the name of the library and where I can find it.


   DETAILS:

   To compile the program on unix I just need to link to lodbc

   The final link command on unix (aix433 in this case) looks like this:

   % gcc -o function_tester -L/host/f/postgresql-8.1.3/aix433/lib
   ceargs.o function_tester.o  -lodbc -llcfdb -Wl

   On windows I get the following error that indicates to me that I need
   a comparable odbc library to link to on windows.

    % link /nologo /warn:3 /NODEFAULTLIB:libcpmt.lib
   /out:function_tester.exe
   *.obj *.res  lcfdb.lib   "/libpath:d:\host\f\postgresql-8.1.3\lib"
   "/libpath:D:\Progra~1\Micros~1\VC98\lib"

    setargv.obj commode.obj

   lcfdb.lib(oconnect.obj) : error LNK2001: unresolved external symbol
   _SQLDisconne[1]ct@4
   lcfdb.lib(oconnect.obj) : error LNK2001: unresolved external symbol
   _SQLFreeHand[2]le@8
   lcfdb.lib(oconnect.obj) : error LNK2001: unresolved external symbol
   _SQLAllocHan[3]dle@12
   ...

   function_tester.exe : fatal error LNK1120: 11 unresolved externals
   NMAKE : fatal error U1077: 'link' : return code '0x460'
   Stop.

 Other information:

   The installation I am using on windows (and unix) is postgres 8.1.3.
   I installed on windows using the postgresql-8.1.msi installer program.

   I use nmake and cl from Microsoft visual studio to compile.


Thanks

Doug



view thread (3+ messages)  latest in thread

Message-ID: <20060316184850.GD2378@codefast.com>
Permalink:  ../20060316184850.GD2378@codefast.com/
Also on:    postgresql.org/message-id/20060316184850.GD2378@codefast.com

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-odbc@postgresql.org
  Cc: stade@codefast.com
  Subject: Re: cannot find odbc library to link to for c program
  In-Reply-To: <20060316184850.GD2378@codefast.com>
  References: <20060316184850.GD2378@codefast.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