OSGeo / gdal

GDAL is an open source MIT licensed translator library for raster and vector geospatial data formats.
https://gdal.org
Other
4.79k stars 2.51k forks source link

undefined reference to `SQLFetchScroll' #2302

Closed jiapei100 closed 4 years ago

jiapei100 commented 4 years ago

Trying to build gdal from source, but failed with the following ERROR messages.

(cd apps; make)
make[1]: Entering directory '....../gdal/gdal/apps'
/bin/bash ....../gdal/gdal/libtool --mode=link --silent g++  gdalinfo_bin.lo  ....../gdal/gdal/libgdal.la  -o gdalinfo
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLFetchScroll'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLRowCount'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_GetGlobalBound'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_GetLayerCapabilities'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_GetAttributesFormat'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLSetConnectOption'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLColAttribute'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLGetData'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `ecs_SetReportErrorFunction'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLInstallDriverEx'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLNumResultCols'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLFreeStmt'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `ecs_CleanUp'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_CreateClient'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_GetServerProjection'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `OGRSQLiteBaseDataSource::FinishNewSpatialite()'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLBindParameter'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLFetch'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `ecs_FindElement'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLDriverConnect'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLGetDiagRec'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLConnect'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLTables'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLDescribeCol'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLRemoveDriver'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLSetConnectAttr'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLDrivers'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLEndTran'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_UpdateDictionary'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLAllocEnv'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLFreeConnect'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLFreeEnv'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_SelectLayer'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_SelectRegion'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLAllocStmt'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLExecDirect'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `OGRSQLiteBaseDataSource::InitNewSpatialite()'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLDisconnect'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_DestroyClient'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLColumns'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLInstallerError'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLPrimaryKeys'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `cln_GetNextObject'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLAllocConnect'
....../gdal/gdal/.libs/libgdal.so: undefined reference to `SQLGetConnectAttr'
collect2: error: ld returned 1 exit status
GNUmakefile:90: recipe for target 'gdalinfo' failed
make[1]: *** [gdalinfo] Error 1
make[1]: Leaving directory '....../gdal/gdal/apps'
GNUmakefile:114: recipe for target 'apps-target' failed
make: *** [apps-target] Error 2
rouault commented 4 years ago

Likely missing ogdi and odbc library. You need to provide the full configure line you've used, but this is likely more an issue with how and which dependencies you've installed

jiapei100 commented 4 years ago

@rouault

➜  gdal git:(master) ✗ ./configure --with-spatialite=yes --with-rasterlite2=yes --with-liblzma=yes --with-mysql=yes --with-ogdi=yes

......

GDAL is now configured for x86_64-pc-linux-gnu

  Installation directory:    /usr/local
  C compiler:                gcc -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2
  C++ compiler:              g++ -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSSE3_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME -g -O2
  C++14 support:             no

  LIBTOOL support:           yes

  LIBZ support:              external
  LIBLZMA support:           yes
  ZSTD support:              yes
  cryptopp support:          no
  crypto/openssl support:    yes
  GRASS support:             no
  CFITSIO support:           external
  PCRaster support:          internal
  LIBPNG support:            external
  DDS support:               no
  GTA support:               no
  LIBTIFF support:           external (BigTIFF=yes)
  LIBGEOTIFF support:        external
  LIBJPEG support:           external
  12 bit JPEG:               no
  12 bit JPEG-in-TIFF:       no
  LIBGIF support:            external
  JPEG-Lossless/CharLS:      yes
  OGDI support:              no
  HDF4 support:              no
  HDF5 support:              yes
  Kea support:               no
  NetCDF support:            yes
  NetCDF has netcdf_mem.h:   yes
  Kakadu support:            no
  JasPer support:            no
  OpenJPEG support:          yes
  ECW support:               no
  MrSID support:             no
  MrSID/MG4 Lidar support:   no
  JP2Lura support:           no
  MSG support:               no
  EPSILON support:           no
  WebP support:              yes
  cURL support (wms/wcs/...):yes
  PostgreSQL support:        yes
  LERC support:              yes
  MySQL support:             yes
  Ingres support:            no
  Xerces-C support:          yes
  Expat support:             yes
  libxml2 support:           yes
  Google libkml support:     yes
  ODBC support:              no
  FGDB support:              no
  MDB support:               no
  PCIDSK support:            internal
  OCI support:               no
  GEORASTER support:         no
  SDE support:               no
  Rasdaman support:          no
  RDB support:               no
  DODS support:              no
  SQLite support:            yes
  PCRE support:              yes
  SpatiaLite support:        yes
  RasterLite2 support:       yes
  Teigha (DWG and DGNv8):    no
  INFORMIX DataBlade support:no
  GEOS support:              yes
  SFCGAL support:            no
  QHull support:             external
  Poppler support:           no
  Podofo support:            no
  PDFium support:            no
  OpenCL support:            no
  Armadillo support:         no
  FreeXL support:            yes
  SOSI support:              no
  MongoDB support:           no
  MongoCXX v3 support:       no
  HDFS support:              no
  TileDB support:            no
  EXR support:               yes
  userfaultfd support:       yes
  misc. gdal formats:        aaigrid adrg aigrid airsar arg blx bmp bsb cals ceos ceos2 coasp cosar ctg dimap dted e00grid elas envisat ers fit gff gsg gxf hf2 idrisi ignfheightasciigrid ilwis ingr iris iso8211 jaxapalsar jdem kmlsuperoverlay l1b leveller map mrf msgn ngsgeoid nitf northwood pds prf r raw rmf rs2 safe saga sdts sentinel2 sgi sigdem srtmhgt terragen til tsx usgsdem xpm xyz zmap rik ozi grib eeda plmosaic rda wcs wms wmts daas rasterlite mbtiles pdf
  disabled gdal formats:    
  misc. ogr formats:         aeronavfaa arcgen avc bna cad csv dgn dxf edigeo flatgeobuf geoconcept georss gml gmt gpsbabel gpx gtm htf jml mvt ntf openair openfilegdb pgdump rec s57 segukooa segy selafin shape sua svg sxf tiger vdv wasp xplane idrisi pds sdts nas ili gmlas ods xlsx amigocloud carto cloudant couchdb csw elastic ngw plscenes wfs gpkg vfk osm
  disabled ogr formats:     

  SWIG Bindings:             no

  PROJ >= 6:                 yes
  enable GNM building:       yes
  enable pthread support:    yes
  enable POSIX iconv support:yes
  hide internal symbols:     no
rouault commented 4 years ago

Which packages are installed for ogdi and odbc : do they include their development packages ? And each time you change the options on ./configure and/or change depending packages, make sure to run make clean, before running make again

jiapei100 commented 4 years ago

Built ... Thank you ... make clean does the trick...