Skip to content

Fix build with Exiv2 0.27

Ting-Wei Lan requested to merge wip/lantw/fix-build-with-exiv2-0.27 into master

The first parameter of Exiv2::Error has changed from an int to an Exiv2::ErrorCode enum.

[1/57] Compiling C++ object 'src/src@@gcm-helper-exiv@exe/gcm-helper-exiv.cpp.o'.
FAILED: src/src@@gcm-helper-exiv@exe/gcm-helper-exiv.cpp.o 
clang++ -B/usr/local/bin -Isrc/src@@gcm-helper-exiv@exe -Isrc -I../../source/gnome-color-manager/src -Isrc/.. -I../../source/gnome-color-manager/src/.. -I/home/lantw44/gnome/devinstall/include/glib-2.0 -I/home/lantw44/gnome/devinstall/lib/glib-2.0/include -I/usr/local/lib/libffi-3.2.1/include -Xclang -fcolor-diagnostics -pipe -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -Wnon-virtual-dtor -O2 -g -march=corei7-avx -B/usr/local/bin -g -O3 -gz -pthread  -MD -MQ 'src/src@@gcm-helper-exiv@exe/gcm-helper-exiv.cpp.o' -MF 'src/src@@gcm-helper-exiv@exe/gcm-helper-exiv.cpp.o.d' -o 'src/src@@gcm-helper-exiv@exe/gcm-helper-exiv.cpp.o' -c ../../source/gnome-color-manager/src/gcm-helper-exiv.cpp
../../source/gnome-color-manager/src/gcm-helper-exiv.cpp:54:10: error: no matching constructor for initialization of 'Exiv2::Error' (aka 'BasicError<char>')
                        throw Exiv2::Error(1, "No filename specified");
                              ^            ~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:272:9: note: candidate constructor not viable: no known conversion from 'int' to 'Exiv2::ErrorCode' for 1st argument
        BasicError(ErrorCode code, const A& arg1);
        ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:276:9: note: candidate constructor template not viable: requires 3 arguments, but 2 were provided
        BasicError(ErrorCode code, const A& arg1, const B& arg2);
        ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:280:9: note: candidate constructor template not viable: requires 4 arguments, but 2 were provided
        BasicError(ErrorCode code, const A& arg1, const B& arg2, const C& arg3);
        ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:268:18: note: candidate constructor not viable: requires single argument 'code', but 2 arguments were provided
        explicit BasicError(ErrorCode code);
                 ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:263:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
    class BasicError : public AnyError {
          ^
../../source/gnome-color-manager/src/gcm-helper-exiv.cpp:63:10: error: no matching constructor for initialization of 'Exiv2::Error' (aka 'BasicError<char>')
                        throw Exiv2::Error(1, error);
                              ^            ~~~~~~~~
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:272:9: note: candidate constructor not viable: no known conversion from 'int' to 'Exiv2::ErrorCode' for 1st argument
        BasicError(ErrorCode code, const A& arg1);
        ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:276:9: note: candidate constructor template not viable: requires 3 arguments, but 2 were provided
        BasicError(ErrorCode code, const A& arg1, const B& arg2);
        ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:280:9: note: candidate constructor template not viable: requires 4 arguments, but 2 were provided
        BasicError(ErrorCode code, const A& arg1, const B& arg2, const C& arg3);
        ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:268:18: note: candidate constructor not viable: requires single argument 'code', but 2 arguments were provided
        explicit BasicError(ErrorCode code);
                 ^
/home/lantw44/gnome/devinstall/include/exiv2/error.hpp:263:11: note: candidate constructor (the implicit copy constructor) not viable: requires 1 argument, but 2 were provided
    class BasicError : public AnyError {
          ^
2 errors generated.
ninja: build stopped: subcommand failed.

I am not familiar with Exiv2 API, but this looks like the easiest way to fix it.

Merge request reports