cd supplibs-2.2.1/src/shp
vim GNUmakefile
第16行后追加以下内容。
-fPIC -shared
修改结果如下图所示,表示修改完成。
第22、23行添加以下内容。
$(CC) $(CFLAGS) shpopen.o dbfopen.o -o libshp.so chmod +x libshp.so
修改结果如下图所示,表示修改完成。
make clean make
mkdir -p /path/to/shp/include mkdir -p /path/to/shp/lib
cp libshp.so /path/to/shp/lib cp shapefil.h /path/to/shp/include
export LD_LIBRARY_PATH=/path/to/shp/lib:$LD_LIBRARY_PATH export C_INCLUDE_PATH=/path/to/shp/include:$C_INCLUDE_PATH export CXX_INCLUDE_PATH=/path/to/shp/include:$CXX_INCLUDE_PATH