You got the include directories right, but you didn't tell it to link in
the library by adding -lpq Try this:
cc -s -I/usr/local/pgsql/include -L/usr/local/pgsql/lib program.c -lm -lnsl
-lpq
-o program.exe
At 03:38 PM 3/29/00, Teruel Tony wrote:
>Hi,
>
>I'm interacting with postgeSQL using C languaje,
>I'm having compilation problems.
>I set the compilation definition as:
>PGSQL_INCLUDE=/usr/local/pgsql/include/libpq
>
>(that's where I got the path to libpq)
>and I'm using something like this (I'm using
>sockets) to compile:
>
>cc -s -I/usr/local/pgsql/include -L/usr/local/pgsql/lib program.c -lm -lnsl
>-o program.exe
>
>By the way I'm using Linux. I got the following error:
>
>/tmp/ccgtGrLd.o: In function `test':
>/tmp/ccgtGrLd.o(.text+0xa): undefined reference to `PQerrorMessage'
>/tmp/ccgtGrLd.o(.text+0x2e): undefined reference to `PQfinish'
>and so on....
>
>Can someone help? What am I doing wrong?
>
>Thanks
>
>
>
>
>Have an excellent day
>[EMAIL PROTECTED]
>Mexico
>
>
>
>
>
>_______________________________________________________
>Get 100% FREE Internet Access powered by Excite
>Visit http://freelane.excite.com/freeisp