Subject: a linking question

From: "Cheng S. Chang" <[email-masked]>
Date: Sat, 12 Jun 93 14:33:26 -0400

Hi !
A linking question:

The command which I executed is as follow:
"cc -I/usr/local/postgres/src/backend/obj -I/usr/local/postgres/src/backend -L/usr/local/postgres/src/libpq/obj test.c -o test"

The message which I received is as follows:
ld: Undefined symbol 
   _PQsetdb 
   _p_write 
   _PQexec 
   _p_open 

How can I compile a program with the above four functions successfully? 

Thanks in advance.

--Martin Chang

---

From: Mike Olson <[email-masked]>
Date: Sat, 12 Jun 1993 11:58:19 -0700

"Cheng S. Chang" <[email-masked]> writes:

> "cc -I/usr/local/postgres/src/backend/obj -I/usr/local/postgres/src/backend -
  +L/usr/local/postgres/src/libpq/obj test.c -o test"
> How can I compile a program with the above four functions successfully? 

add -lpq to the cc command line.