I had to do a reset today due to some stuff I had broken on my arch linux and found a new error during compilation:
[ 21%] Building CXX object src/CMakeFiles/gplates-lib.dir/file-io/GdalRasterWriter.cc.o /home/mruks/GPlates/src/file-io/GdalRasterWriter.cc: In function ‘bool {anonymous}::does_driver_support_creation(const char*)’: /home/mruks/GPlates/src/file-io/GdalRasterWriter.cc:104:61: error: invalid conversion from ‘CSLConstList’ {aka ‘const char* const*’} to ‘char**’ [-fpermissive] 104 | char **driver_metadata = driver->GetMetadata(); | ~~~~~~~~~~~~~~~~~~~^~ | | | CSLConstList {aka const char* const*} /home/mruks/GPlates/src/file-io/GdalRasterWriter.cc: In function ‘std::vector<GPlatesPropertyValues::RasterType::Type> {anonymous}::get_supported_band_types(const char*)’: /home/mruks/GPlates/src/file-io/GdalRasterWriter.cc:138:61: error: invalid conversion from ‘CSLConstList’ {aka ‘const char* const*’} to ‘char**’ [-fpermissive] 138 | char **driver_metadata = driver->GetMetadata(); | ~~~~~~~~~~~~~~~~~~~^~ | | | CSLConstList {aka const char* const*} /home/mruks/GPlates/src/file-io/GdalRasterWriter.cc: In constructor ‘GPlatesFileIO::GDALRasterWriter::GDALRasterWriter(const QString&, const GPlatesFileIO::RasterWriter::FormatInfo&, unsigned int, unsigned int, unsigned int, GPlatesPropertyValues::RasterType::Type, bool)’: /home/mruks/GPlates/src/file-io/GdalRasterWriter.cc:440:65: error: invalid conversion from ‘CSLConstList’ {aka ‘const char* const*’} to ‘char**’ [-fpermissive] 440 | char **file_driver_metadata = d_file_driver->GetMetadata(); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~ | | | CSLConstList {aka const char* const*} make[2]: *** [src/CMakeFiles/gplates-lib.dir/build.make:3507: src/CMakeFiles/gplates-lib.dir/file-io/GdalRasterWriter.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:600: src/CMakeFiles/gplates-lib.dir/all] Error 2 make: *** [Makefile:156: all] Error 2
What I found weird is that I actually used my updated package list, so didn’t know what was wrong. I even added doxygen, dpkg, debhelper and devscripts to allow for documentation and debian package support in case something went wrong with an update. I did some digging and found out this apparently is due to an issue with a newer version of GDAL.
Lines like char **GetMetadata() don’t get supported anymore. Apparently ** isn’t accepted anymore. So the workaround for me (this is honestly way further than what I know about c++ so a workarround was easier then go into the code to figure it out
) according to the forums is instead of:
cmake .
make
it should be this:
cmake -DCMAKE_CXX_FLAGS=“-fpermissive” .
make -j$(nproc)
From what I understood it turns the ** errors into warnings, which allow it to compile. No idea if that’s a good thing or not. If I messed it up in some way, please let me know ![]()
Thank you in advance for letting me know what you guys think about this ![]()