dfandrich / gpscorrelate

C program to match GPS tracks to photographs, and store the matches in the EXIF data in the photographs.
https://dfandrich.github.io/gpscorrelate/
GNU General Public License v2.0
24 stars 8 forks source link

Build failure against exiv2-0.28.0 #22

Closed a17r closed 8 months ago

a17r commented 12 months ago

Exiv2 0.28.0 was released on 2023-05-08.

exif-gps.cpp:100:23: error: ‘AutoPtr’ is not a member of ‘Exiv2::Image’
  100 |         Exiv2::Image::AutoPtr Image;
      |                       ^~~~~~~
exif-gps.cpp:103:17: error: ‘Image’ was not declared in this scope; did you mean ‘Exiv2::Image’?
  103 |                 Image = Exiv2::ImageFactory::open(File);
      |                 ^~~~~
      |                 Exiv2::Image
In file included from exif-gps.cpp:44:
/usr/include/exiv2/image.hpp:50:16: note: ‘Exiv2::Image’ declared here
   50 | class EXIV2API Image {
      |                ^~~~~
exif-gps.cpp:108:9: error: ‘Image’ was not declared in this scope; did you mean ‘Exiv2::Image’?
  108 |         Image->readMetadata();
      |         ^~~~~
      |         Exiv2::Image
/usr/include/exiv2/image.hpp:50:16: note: ‘Exiv2::Image’ declared here
   50 | class EXIV2API Image {
      |                ^~~~~
exif-gps.cpp: In function ‘char* ReadExifData(const char*, double*, double*, double*, int*)’:
exif-gps.cpp:157:23: error: ‘AutoPtr’ is not a member of ‘Exiv2::Image’
  157 |         Exiv2::Image::AutoPtr Image;
      |                       ^~~~~~~
exif-gps.cpp:160:17: error: ‘Image’ was not declared in this scope; did you mean ‘Exiv2::Image’?
  160 |                 Image = Exiv2::ImageFactory::open(File);
      |                 ^~~~~
      |                 Exiv2::Image

Full build.log in downstream report: https://bugs.gentoo.org/906498

See also: https://github.com/Exiv2/exiv2/issues/2630

dfandrich commented 12 months ago

I noticed a patch to fix this in OpenMandriva (https://github.com/OpenMandrivaAssociation/gpscorrelate/blob/master/gpscorrelate-2.0-exiv2-0.28.patch) but it's not backwards-compatible to older exiv2 version, so I can't apply it as-is.

a17r commented 12 months ago

One way to do it backwards-compatible would be to switch to std::unique_ptr<Exiv2::Image> instead, otherwise you can always do #if EXIV2_TEST_VERSION(0, 28, 0)

dfandrich commented 8 months ago

I've submitted a fix for this that preserves the ability to compile against older versions of exiv2.