Opened 23 years ago

Last modified 23 years ago

#68 closed defect (fixed)

libpq not linked properly? (can't compile)

Reported by: Timothy.Keitt@… Owned by: warmerdam
Priority: high Milestone:
Component: default Version: unspecified
Severity: normal Keywords:
Cc:

Description

I get this error:

c++  gdal_translate.o  \
	-L/home/tkeitt/src/gdal -lgdal.1.1 -o gdal_translate
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQconnectdb'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `lo_write'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQexec'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQsetNoticeProcessor'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQntuples'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `lo_read'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQclear'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQresultStatus'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQgetvalue'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQstatus'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQnfields'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `lo_creat'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQfname'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `lo_open'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `lo_close'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQfinish'
/home/tkeitt/src/gdal/libgdal.1.1.so: undefined reference to `PQerrorMessage'
collect2: ld returned 1 exit status

I think because:

c++ -shared  ./frmts/o/*.o ./core/*.o ./port/*.o ./alg/*.o ./ogr/ogrct.o
./ogr/ogr_opt.o ./ogr/ogr_fromepsg.o ./ogr/ogrutils.o ./ogr/ogr_srs_proj4.o
./ogr/ogrsf_frmts/generic/ogrregisterall.o ./ogr/ogrfeaturestyle.o
./ogr/ogrsf_frmts/ogrsf_frmts.a -L/usr/local/lib ./gdal.a ./ogr/ogr.a ./gdal.a
./port/cpl.a  -lgif -ljpeg -ltiff -lpng -lz -lm -ldl -L/usr/local/lib -lm -o
./libgdal.1.1.so

does not have "-lpq" or perhaps it should appear in the first listing

Change History (2)

comment:1 by warmerdam, 23 years ago

Tim,

You are right about what went wrong; however, I think it is fixed in GDAL now
if you rerun configure.  If you are working from gdal-1.1.5b1 then you could 
upgrade to gdal-1.1.5b2 at:

  ftp://ftp.remotesensing.org/pub/gdal/gdal-1.1.5b2.tar.gz

comment:2 by warmerdam, 23 years ago

"Timothy H. Keitt" wrote:
> 
> > Tim,
> >
> > You are right about what went wrong; however, I think it is fixed in GDAL
now
> > if you rerun configure.  If you are working from gdal-1.1.5b1 then you could
> > upgrade to gdal-1.1.5b2 at:
> >
> >   ftp://ftp.remotesensing.org/pub/gdal/gdal-1.1.5b2.tar.gz
> >
> 
> I was using the CVS version.  I'll try the tar.

Tim, 

The tar is just a snapshot from CVS this morning. 

... just checked, I hadn't commited the -lpq fix to cvs.  It is committed
now.  No point in trying the tar file, it's broken too. 

Best regards,
Note: See TracTickets for help on using tickets.