[Gdal-dev] Reading/Writing via GDAL library

t chheng tcchheng at ucsd.edu
Fri Apr 20 17:41:43 EDT 2007


Hi there,
GDAL produced gdal14.dll

I tried:
-L/c/ossimcvs/gdal-1.4.0/lib -lgdal 
-L/c/ossimcvs/gdal-1.4.0/lib -lgdal14
-L/c/ossimcvs/gdal-1.4.0/lib -l"gdal14.dll"

all with the same error.

tommy


Mateusz Loskot wrote:
> 
> t chheng wrote:
>> 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?
> 
> 
> I've never used MinGW to build GDAL but I suppose the library specifier
> for GDAL is incorrect, may be MinGW needs some special form of -lgdal if
> you want to link with import library for DLL, may be -llibgdal...
> 
> Check what binaries you have got after you GDAL building.
> 
> Cheers
> -- 
> Mateusz Loskot
> http://mateusz.loskot.net
> _______________________________________________
> Gdal-dev mailing list
> Gdal-dev at lists.maptools.org
> http://lists.maptools.org/mailman/listinfo/gdal-dev
> 
> 

-- 
View this message in context: http://www.nabble.com/Reading-Writing-via-GDAL-library-tf3620307.html#a10110730
Sent from the GDAL - Dev mailing list archive at Nabble.com.




More information about the Gdal-dev mailing list