Hi <br><br>Now I found the way to call the shapelib functions to my program in C++.<br>There is a sample of my little code, well I took the code from a shpcreat.c and rename it as shpcreate.cpp<br><br>[Code]<br>static char rcsid[] = <br>
"$Id: shpcreate.c,v 1.5 2002/01/15 14:36:07 warmerda Exp $";<br>#include <iostream><br>#include <cstdlib><br>#include "shapefil.h"<br>#include "string.h"<br><br><br>using namespace std;<br>
int main()<br><br>{<br> SHPHandle hSHP;<br> int nShapeType;<br> string shape_name;<br><br>//Here the program ask for a name <br> cout << "Name of the new shapefile?: " << endl;<br>
getline(cin,shape_name);<br><br> cout << "The program will show the name of the shapefile: " << nombre_archivo << endl;<br><br>//Here the program creates the shapefile. Gives a name and a type<br>
nShapeType=5;<br> hSHP = SHPCreate( shape_name.c_str(), nShapeType );<br><br> SHPClose( hSHP );<br><br> return 0;<br>}<br>[/CODE]<br><br>This little program runs in windows with the library in dll and in linux, but under Linux I must generate and shpopen.o and after compile in this way.<br>
<br>g++ -g shpcreate.cpp shpopen.o -o myprogram<br><br>And I have a good result. <br><br>The secret was to put include these libraries: cstdlib and string.h. <br><br>The way is very easy. <br>Now I have another problem, but I'll try to solve it myself and if I have can't I'll ask :)<br>
<br>See you.<br><br>Thanks<br><br><br>