[Gdal-dev] Reading/Writing via GDAL library
t chheng
tcchheng at ucsd.edu
Fri Apr 20 15:54:37 EDT 2007
Hi,
I'm trying to read/write to vector shapefiles using the GDAL/OGR library.
I have compiled gdal-1.4.0 and have gdal14.dll
Now I'm trying to use the example code from the tutorial to get the sample
read/write of vector files working.
http://www.gdal.org/ogr/ogr_apitut.html
My sample code is basically
#include <ogrsf_frmts.h>
int main(int argc, char* argv[])
{
readShapeFile();
return 0;
}
where readShapeFile is the code provided from the tutorial.
When I compile(note that the dll location is specified
-L/c/ossimcvs/gdal-1.4.0/lib -lgdal, i also tried -lgdal14), i get an
undefined reference error.
C:\msys\1.0\bin\make all
if [ ! -d /.shared_obj ] ; then mkdir /.shared_obj ; fi
g++ -mthreads -Wall -pipe -O2 -g3 -L/c/Imaging/OpenCV/lib -lcxcore -lcv
-lhighgui -lcvaux -L/c/ossimcvs/bin -lossimcontrib_plugin -L/c/ossimcvs/bin
-lossimopencv_plugin -L/c/ossimcvs/gdal-1.4.0/lib -lgdal ship_detect.o
-L/c/ossimcvs/ossim/lib/ossim -lossim
-L/c/ossimcvs/libgeotiff-1.2.3/lib -L/c/ossimcvs/tiff-3.8.2/lib -lgeotiff
-ltiff -L/c/ossimcvs/jpeg-6b -ljpeg -lm -ljpeg -o ship_detect.exe
Info: resolving ossimProjection::RTTI_obj by linking to
__imp___ZN15ossimProjection8RTTI_objE (auto-import)
Info: resolving vtable for ossimStdOutProgressby linking to
__imp___ZTV19ossimStdOutProgress (auto-import)
ship_detect.o: In function
`ZNSt6vectorI7BlobBoxSaIS0_EE13_M_insert_auxEN9__gnu_cxx17__normal_iteratorIPS0_S2_EERKS0_':C:/ossimcvs/ossimConsole/ship_detect.cpp:(.text+0xe):
undefined reference to `OGRRegisterAll'
:C:/ossimcvs/ossimConsole/ship_detect.cpp:(.text+0x22): undefined reference
to `OGRSFDriverRegistrar::Open(char const*, int, OGRSFDriver**)'
Any ideas why it isn't finding the correct references?
Thanks
--
View this message in context: http://www.nabble.com/Reading-Writing-via-GDAL-library-tf3620307.html#a10109181
Sent from the GDAL - Dev mailing list archive at Nabble.com.
More information about the Gdal-dev
mailing list