[Shapelib] need some help

Frank Warmerdam warmerdam at pobox.com
Wed Mar 9 09:54:50 EST 2011

On 11-03-09 06:19 AM, calpas calpas wrote:
> Dear all,
> I am writting my first C application to access the shapefile and retrieve some
> data. I'm trying to use the shapelib to achieve that unfortunately I'm keeping
> on having the following errors:
> /home/geotema/valatest/src/readshapetest.c:19: undefined reference to `SHPOpen'
> /home/geotema/valatest/src/readshapetest.c:21: undefined reference to `SHPGetInfo'
> I cannot figure out what is missing. could anyone help me to sort out this issue???

Calpas Calpas,

Presumably you are not linking against the shapelib modules.  You
don't give your compile or link information so I can't propose a
variation but basically you will likely need to include the object
code from shapelib in your link in some fashion.  Perhaps by listing
the paths to shpopen.o, dbfopen.o, safileio.o and perhaps shptree.o.

Looking at how the commandline programs in shapelib are linked in
shapelib/Makefile might give you a hint as to how to do so.

Best regards,
I set the clouds in motion - turn up   | Frank Warmerdam, warmerdam at pobox.com
light and sound - activate the windows | http://pobox.com/~warmerdam
and watch the world go round - Rush    | Geospatial Programmer for Rent

More information about the Shapelib mailing list