Re: really simple example of c-code and pqlib library

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Waldemar Biernacki <wb(at)sao(dot)pl>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: really simple example of c-code and pqlib library
Date: 2006-06-24 19:42:02
Message-ID: 20060624194202.GA9916@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Sat, Jun 24, 2006 at 10:29:27AM +0200, Waldemar Biernacki wrote:
> c++ \
> -I/usr/include/postgresql \
> -I/usr/include/postgresql/libpq \
> -L/usr/lib/libpq.a \
> test.cpp -o x

Check your compiler's documentation, but the -L option generally
takes a directory argument, not a file. On most systems /usr/lib
is searched automatically, so if that's where libpq is then you
shouldn't need -L at all. To link your program against libpq use
-lpq. See "Building libpq programs" for more information:

http://www.postgresql.org/docs/8.1/interactive/libpq-build.html

--
Michael Fuhr

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-06-26 12:43:04 Re: libpq Describe Extension [WAS: Bytea and perl]
Previous Message Volkan YAZICI 2006-06-24 11:45:33 Re: libpq Describe Extension [WAS: Bytea and perl]