[GRASS-dev] undefined reference to gdal version 1.8

Hi all,

trying to build grass7.0 from release branch. I am getting lot of undefined references

From terminal :

/usr/bin/make -C g.mremove || echo /packages/grass70-7.0/general/g.mremove >> /packages/grass70-7.0/error.log
make[4]: Entering directory /packages/grass70-7.0/general/g.mremove' test -d OBJ.x86_64-pc-linux-gnu || mkdir -p OBJ.x86_64-pc-linux-gnu gcc -D_FORTIFY_SOURCE=2 -Wall -g -O -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\" -I/usr/include/postgresql -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -o OBJ.x86_64-pc-linux-gnu/check_reclass.o -c check_reclass.c gcc -D_FORTIFY_SOURCE=2 -Wall -g -O -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -I/usr/include/gdal -I/usr/include -DPACKAGE=\""grassmods"\" -I/usr/include/postgresql -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -I/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/include -o OBJ.x86_64-pc-linux-gnu/main.o -c main.c : && gcc -L/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib -L/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,--export-dynamic -Wl,-rpath-link,/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib -o /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/bin/g.mremove OBJ.x86_64-pc-linux-gnu/check_reclass.o OBJ.x86_64-pc-linux-gnu/main.o -lgrass_manage.7.0.0svn -lgrass_raster.7.0.0svn -lgrass_gis.7.0.0svn -lm /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGRGeometryTypeToName@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_GetY@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_SetGeometry@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_GetGeometryType@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_Create@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_F_GetFID@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRGetLinearUnits@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.0.0svn.so: undefined reference to OSRExportToWkt@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRGetAttrValue@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_AddPoint@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to SetCSVFilenameHook@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_GetLayerCount@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_L_CreateField@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_Fld_SetWidth@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to CSLDestroy@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_AddGeometry@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRExportToProj4@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_L_ResetReading@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_Fld_Destroy@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_L_CommitTransaction@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRMorphFromESRI@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_L_GetNextFeature@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRExportToPrettyWkt@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_GetPointCount@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRMorphToESRI@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_Dr_GetName@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_L_GetFIDColumn@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.0.0svn.so: undefined reference to OSRImportFromProj4@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_GetGeometryRef@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to CSLSetNameValue@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRDestroySpatialReference@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_GetLayerByName@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_L_TestCapability@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_GetLayer@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_Destroy@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_L_GetLayerDefn@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_Fld_Create@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.0.0svn.so: undefined reference to VSIFree@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGRRegisterAll@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_GetZ@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_FD_GetFieldIndex@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_F_SetFieldInteger@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGRGetDriverByName@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_F_GetFieldIndex@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGROpen@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_L_GetFeature@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRIsProjected@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_GetGeometryCount@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_FD_GetGeomType@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_CreateGeometry@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_UnsetField@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_DestroyGeometry@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_L_StartTransaction@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_DeleteLayer@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRNewSpatialReference@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_L_CreateFeature@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_L_GetFeatureCount@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_G_GetGeometryRef@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_gproj.7.0.0svn.so](http://libgrass_gproj.7.0.0svn.so): undefined reference to OSRIsGeographic@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_Dr_CreateDataSource@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_SetFieldString@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_GetDriver@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_FD_GetName@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_Destroy@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_F_SetFieldDouble@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to OGR_DS_CreateLayer@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_L_DeleteFeature@GDAL_1.8’
/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_gproj.7.0.0svn.so: undefined reference to OSRGetUTMZone@GDAL_1.8' /packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/[libgrass_vector.7.0.0svn.so](http://libgrass_vector.7.0.0svn.so): undefined reference to OGR_G_GetX@GDAL_1.8’
collect2: ld returned 1 exit status
make[4]: *** [/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/bin/g.mremove] Error 1

Regards,
Rashad

On Thu, May 22, 2014 at 1:35 PM, Rashad M <mohammedrashadkm@gmail.com>wrote:

/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/
libgrass_vector.7.0.0svn.so: undefined reference to
`OGRGeometryTypeToName@GDAL_1.8'

I just had that with trunk but you will not like my solution. I reinstalled
Ubuntu. My guess is that it was caused by combined gdal installations. The
machine had Ubuntu 14.04 (gdal 1.10) but installed from 13.10 (gdal 1.9)
and it had also development version of gdal (gdal 1.12) in /opt. I don't
know from where 1.8 came from.

Vaclav

Hi Vaclav,

Thanks for reply. Re-installing Ubuntu cannot be done for my case. There were two gdal version /usr/
and /usr/local

For the moment removing gdal from local
rm -f /usr/local/libgdal* rm -f /usr/local/bin/gdal*

and install grass and then I did just sudo make install in gdal. This worked but still ugly solution.

···

On Thu, May 22, 2014 at 11:37 PM, Vaclav Petras <wenzeslaus@gmail.com> wrote:

Regards,
Rashad

On Thu, May 22, 2014 at 1:35 PM, Rashad M <mohammedrashadkm@gmail.com> wrote:

/packages/grass70-7.0/dist.x86_64-pc-linux-gnu/lib/libgrass_vector.7.0.0svn.so: undefined reference to `OGRGeometryTypeToName@GDAL_1.8’

I just had that with trunk but you will not like my solution. I reinstalled Ubuntu. My guess is that it was caused by combined gdal installations. The machine had Ubuntu 14.04 (gdal 1.10) but installed from 13.10 (gdal 1.9) and it had also development version of gdal (gdal 1.12) in /opt. I don’t know from where 1.8 came from.

Vaclav

Rashad M wrote:

Thanks for reply. Re-installing Ubuntu cannot be done for my case. There
were two gdal version /usr/
and /usr/local

For the moment removing gdal from local
rm -f /usr/local/libgdal* rm -f /usr/local/bin/gdal*

and install grass and then I did just sudo make install in gdal. This
worked but still ugly solution.

Even if this fixes the compilation problems, attempts to run GRASS
modules may fail due to loading the wrong version of GDAL.

In short, it's only safe to have multiple versions of a library
installed if each version has a different "soname". AFAICT, all
versions of GDAL have the soname "libgdal.so.1".

--
Glynn Clements <glynn@gclements.plus.com>