<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:times new roman,new york,times,serif;font-size:12pt">Dear all,<br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><div>&nbsp;this is a simple program I' writting in order to collect the shapefile type:<br>#include "shapelib/shapefil.h"<br>#include &lt;string.h&gt;<br>#include &lt;stdlib.h&gt;<br>#include &lt;stdio.h&gt;<br><br>int main (int argc, char ** argv)<br>{<br>&nbsp;&nbsp;&nbsp; &nbsp;char * filepath;<br>&nbsp;&nbsp;&nbsp; &nbsp;char *&nbsp; accessType;<br>&nbsp;&nbsp;&nbsp; int *&nbsp; pnEntities;<br>&nbsp;&nbsp;&nbsp; int * pnShapeType = NULL;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; double * padfMinBound; <br>&nbsp;&nbsp;&nbsp; double *
 padfMaxBound;<br>&nbsp;&nbsp;&nbsp; SHPHandle hSHP;<br>&nbsp;&nbsp;&nbsp; FILE * istream;<br><br>&nbsp;&nbsp;&nbsp; filepath= "/home/geotema/valatest/data/point_bycicle_sharing.shp";<br>&nbsp;&nbsp;&nbsp; accessType= "rb";<br>&nbsp;&nbsp;&nbsp;
 <br>&nbsp;&nbsp;&nbsp; if ( (istream = fopen ( filepath, "rb" ) ) == NULL )<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf ( "file non-existant!\n" );<br>&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp; else<br>&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; printf ( "file exists!\n" );<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; hSHP = SHPOpen(filepath,"rb");<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; SHPGetInfo(hSHP,pnEntities,pnShapeType, padfMinBound, padfMaxBound);<br>&nbsp;&nbsp;&nbsp; hSHP = (SHPHandle)malloc(sizeof(SHPHandle));<br>&nbsp;&nbsp;&nbsp; printf("hELLO World \nShape type %d\n&nbsp; ", hSHP-&gt;nShapeType);<br>&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; fclose ( istream );<br>&nbsp;&nbsp;&nbsp; }<br><br>&nbsp;&nbsp;&nbsp; return 1;<br>}<br><br>In order to link my program with the shape lib, what I've through my Makefile.am is defining the following
 parameters:<br><br>bin_PROGRAMS= readshapetest<br>readshapetest_SOURCES = readshapetest.c shapelib/shpopen.c shapelib/shapefil.h <br>clean:<br>&nbsp;&nbsp;&nbsp; rm -f *.o *.c<br><br>the compiling step is successful, unfortunately I'm keeping on having 0 as output. can you please tell me where I'm failing<br><br>Cheers.......<br></div>
</div><br>




      </div></div>
</div><br>




      </body></html>