[Shapelib] /contrib/ utilities make error

guy picton phillipps gpictonphillipps at wcs.org
Fri Apr 23 05:34:50 EST 2010


Hello listers,

A further Make question - this time when attempting to run make in the 
contrib directory to build the following binaries: dbfcat, dbfinfo, 
shpcat, shpcentrd, shpdata, shpdxf, shpfix, shpinfo, shpproj & shpwkb.

I am installing on fresh Ubuntu9.10 32-bit server, having previously 
installed:

freetype-2.3.12
gd-2.0.35
jpegsrc.v6b
libpng-1.4.1
proj-4.7.0
zlib-1.2.5
shapelib (dbfadd, dbfcreate, dbfdump, shpadd, shpcreate, shpdump, 
shprewind & shptest)


When running 'make' in the contrib directory as root, I get the 
following output:

==================================================================
root at vbox9-10serveri386:/usr/local/src/shapelib-1.3.0b1/contrib# make
cc -g -I.. -DPROJ4 -D_LITTLE_ENDIAN -DDEBUG -DDEBUG2  shpdxf.c 
../shpopen.o ../dbfopen.o   -o shpdxf
shpdxf.c: In function âmainâ:
shpdxf.c:218: warning: incompatible implicit declaration of built-in 
function âexitâ
shpdxf.c:221: warning: incompatible implicit declaration of built-in 
function âstrcpyâ
shpdxf.c:222: warning: incompatible implicit declaration of built-in 
function âstrncpyâ
shpdxf.c:222: warning: incompatible implicit declaration of built-in 
function âstrlenâ
shpdxf.c:223: warning: incompatible implicit declaration of built-in 
function âstrcatâ
../shpopen.o: In function `SHPOpen':
/usr/local/src/shapelib-1.3.0b1/shpopen.c:440: undefined reference to 
`SASetupDefaultHooks'
../shpopen.o: In function `SHPCreate':
/usr/local/src/shapelib-1.3.0b1/shpopen.c:803: undefined reference to 
`SASetupDefaultHooks'
../dbfopen.o: In function `DBFOpen':
/usr/local/src/shapelib-1.3.0b1/dbfopen.c:368: undefined reference to 
`SASetupDefaultHooks'
../dbfopen.o: In function `DBFCreateEx':
/usr/local/src/shapelib-1.3.0b1/dbfopen.c:645: undefined reference to 
`SASetupDefaultHooks'
collect2: ld returned 1 exit status
make: *** [shpdxf] Error 1
==================================================================

I assume that the warnings are ok, but the undefined references seem to 
cause a problem. I have looked at the lines in shpopen.c & dbfopen.c, 
and have found SASetupDefaultHooks in the shapefil.h library, but afraid 
that this hasn't given me much insight into solving the problem.

The relevant lines from shpopen.c, dbfopen.c & shapefil.h are as follows:

shpopen.c - line 440: SASetupDefaultHooks( &sHooks );
shpopen.c - line 803: SASetupDefaultHooks( &sHooks );
dbfopen.c - line 368: SASetupDefaultHooks( &sHooks );
dbfopen.c - line 645: SASetupDefaultHooks( &sHooks );
 
shapefil.h - line 247: void SHPAPI_CALL SASetupDefaultHooks( SAHooks 
*psHooks );

I noticed that there seem to be 2 arguments for SASetupDefaultHooks 
(although I wonder if the asterix means the second is optional?), but 
only one is provided in the shpopen.c & dbfopen.c  - could this be the 
cause of the problem?


For information -  make check yields the following:

================================================
root at vbox9-10serveri386:/usr/local/src/shapelib-1.3.0b1/contrib# make check
tests/shpproj.sh
rm: cannot remove `test*': No such file or directory
tests/shpproj.sh: 21: ../shpproj: not found
tests/shpproj.sh: 22: ../shpproj: not found
tests/shpproj.sh: 23: ../shpproj: not found
failure...
=================================================


as ever will be grateful for any suggestions as to the cause of this.

Many thanks,

Guy



-- 

Guy Picton Phillipps (MSc)
Remote Sensing & GIS
WCS Tanzania Program

www.wcs.org <http://www.wcs.org>



More information about the Shapelib mailing list