Thread: undefined reference pq

undefined reference pq

From
"Jeff Lu"
Date:
Hi,

Can some one tell me what am I missing?

$ make intrasend
gcc -o /c/inetpub/wwwroot/cgi-bin/intrasend.exe intrasend.c
intrautils.c -I/usr/
local/pgsql/include -L/usr/local/pgsql/lib
intrautils.c:7: warning: initialization makes integer from pointer without a
cas
t
/c/TEMP/ccXES02E.o(.text+0x32c):intrasend.c: undefined reference to
`PQconnectdb
'
/c/TEMP/ccXES02E.o(.text+0x346):intrasend.c: undefined reference to
`PQstatus'
/c/TEMP/ccXES02E.o(.text+0x37b):intrasend.c: undefined reference to
`PQerrorMess
age'
/c/TEMP/ccXES02E.o(.text+0x3d1):intrasend.c: undefined reference to `PQexec'
/c/TEMP/ccXES02E.o(.text+0x3eb):intrasend.c: undefined reference to
`PQresultSta
tus'
/c/TEMP/ccXES02E.o(.text+0x41d):intrasend.c: undefined reference to
`PQclear'
/c/TEMP/ccXES02E.o(.text+0x42f):intrasend.c: undefined reference to
`PQfinish'
/c/TEMP/ccXES02E.o(.text+0x457):intrasend.c: undefined reference to
`PQntuples'
/c/TEMP/ccXES02E.o(.text+0x47c):intrasend.c: undefined reference to
`PQgetvalue'

/c/TEMP/ccXES02E.o(.text+0x4a3):intrasend.c: undefined reference to
`PQclear'
/c/TEMP/ccXES02E.o(.text+0x4b5):intrasend.c: undefined reference to
`PQfinish'
collect2: ld returned 1 exit status
make: *** [intrasend] Error 1




Re: undefined reference pq

From
Peter Eisentraut
Date:
Jeff Lu writes:

> $ make intrasend
> gcc -o /c/inetpub/wwwroot/cgi-bin/intrasend.exe intrasend.c
> intrautils.c -I/usr/
> local/pgsql/include -L/usr/local/pgsql/lib

-lpq

> intrautils.c:7: warning: initialization makes integer from pointer without a
> cas
> t
> /c/TEMP/ccXES02E.o(.text+0x32c):intrasend.c: undefined reference to
> `PQconnectdb'
[...]

-- 
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/