Your problem is the error:

/usr/bin/ld: cannot find -lpq

Postgres should install a library named libpq.so somewhere on your system, 
perhaps in usr/lib, or /usr/local/lib - you may need to install the postgres-
devel pacakage as well as the postgres package, in order to get this library. 
Once you have the library installed, you need to make sure that the directory 
it is in is listed in your /etc/ld.so.conf file - if you need to add the 
directory to that file (not uncommon) you must run the command 'ldconfig' as 
root after saving the file.

Once you have verified that the libpq library is installed, and checked your ld 
config, you should try to compile again.

If you have any more problems, you should join the postgis-users list and send 
your problems there - more minds can generate more solutions.

Chris

Quoting Gregory GIULIANI <gregory.giuliani@grid.unep.ch>:

> Dear sir,
> I'm trying to compile postgis 0.7.5 with PGsql 7.3.1 under Linux.
> I have the following error message:
> 
> gcc -O2 -Wall -Wmissing-prototypes -Wmissing-declarations shpopen.o dbfopen.o
> getopt.o shp2pgsql.o -L../../../src/interfaces/libpq -lpq
> -Wl,-rpath,/usr/local/pgsql/lib/contrib -lz -lreadline -lncurses -lcrypt
> -lresolv -lnsl -ldl -lm -lbsd  -o shp2pgsql
> /usr/bin/ld: cannot find -lpq
> collect2: ld returned 1 exit status
> make[1]: *** [shp2pgsql] Error 1
> make[1]: Leaving directory
> `/usr/local/src/postgresql-7.3.1/contrib/postgis/loader'
> make: *** [loaderdumper] Error 2
> 
> I did find a solution, so could you please help me to find a way to install
> properly PostGIS.
> 
> With kind regards
> 
> Gregory Giuliani
> --
> ******************************************
> Gregory GIULIANI
> Web Designer & Programmer
> UNEP/DEWA/GRID-Geneva
> 11, chemin des Anemones
> CH-1219 CHATELAINE (Geneva)
> Phone: +41 22 917 84 17
> Fax: +41 22 917 80 29
> Email: gregory.giuliani@grid.unep.ch
> Web Site: http://www.grid.unep.ch
> ******************************************
> 





