3

I recently decided to reinstall QGIS and build against the latest version of GDAL - something I have been putting off for ages because I suspected it would be a nightmare. Lo and behold it has been, so after a full-day of trying to get this to compile following these: instructions I'm reaching out for some help.

I successfully built GDAL 2.0 this morning (at least I think it was successful gdalinfo --version is now showing GDAL 2.0.0, released 2015/06/14 and have been working my way through the instructions above.

I'm currently stuck at 47% with make failing here:

[ 47%] Built target qgis.d.rast7
Linking C executable ../../../../output/lib/qgis/grass/modules/qgis.g.info7
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRGetLinearUnits@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRExportToWkt@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRGetAttrValue@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `SetCSVFilenameHook@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRExportToProj4@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRMorphFromESRI@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRExportToPrettyWkt@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRMorphToESRI@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRImportFromProj4@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRDestroySpatialReference@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `VSIFree@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRIsProjected@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRNewSpatialReference@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRIsGeographic@GDAL_1.8'
/usr/lib/grass70/lib/libgrass_gproj.so: undefined reference to `OSRGetUTMZone@GDAL_1.8'
collect2: error: ld returned 1 exit status
make[2]: *** [output/lib/qgis/grass/modules/qgis.g.info7] Error 1
make[1]: *** [src/providers/grass/7/CMakeFiles/qgis.g.info7.dir/all] Error 2
make: *** [all] Error 2

I'm not quite sure what this means - though some searching suggests I may still have an old install of GDAL lurking, though not sure I can find it - as I removed a couple earlier when make failed much earlier on.

I thought it could be something to do with Grass 7 which I installed following these enter link description here instructions. But I've also tried to compile with GRASS_PREFIX7 set to OFF in ccmake. But make fails at the same place.

p.s. using: Ubuntu 14.04 GRASS7 GDAL 2.0

1

If you build gdal yourself, you should also build grass yourself.

Using grass binaries which are linked against a different version of gdal than QGIS is certainly a very bad idea.

| improve this answer | |
  • Yea, from glancing at the OPs errors it looks like GRASS just needs to be re-compiled against the updated GDAL they installed first. – SaultDon Jan 3 '17 at 18:48
0

I had the same issue. It was related to the flags in cmake. My purpose was not related to GRASS 7 so I just had to desactivate it.

My line for compiling is similar to below (I didn't provide all the options just the ones related to GRASS)

cmake -DWITH_GRASS=OFF -DWITH_GRASS7=OFF ..

You need to do before a

make clean

You can also check if your configuration related to GRASS is effective looking at generated file CMakeCache.txt. It should contain something like below:

...
//Determines whether GRASS 6 plugin should be built
WITH_GRASS:BOOL=OFF

//Determines whether GRASS 7 plugin should be built
WITH_GRASS7:BOOL=OFF
...
| improve this answer | |
  • thanks for the comments @ThomasG77 - thing is I want to build QGIS against GRASS as I need GRASS plugin support in QGIS. I have managed to get this compiled without GRASS but missing the plugins:( – marty_c Aug 10 '15 at 14:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.