diff --git a/samples/exifprint.cpp b/samples/exifprint.cpp index 31599949..08d60117 100644 --- a/samples/exifprint.cpp +++ b/samples/exifprint.cpp @@ -44,7 +44,9 @@ try { return 0; } -catch (Exiv2::AnyError& e) { - std::cout << "Caught Exiv2 exception '" << e << "'\n"; +//catch (std::exception& e) { +//catch (Exiv2::AnyError& e) { +catch (Exiv2::Error& e) { + std::cout << "Caught Exiv2 exception '" << e.what() << "'\n"; return -1; } diff --git a/src/error.hpp b/src/error.hpp index 80b659d2..8cf6a8bd 100644 --- a/src/error.hpp +++ b/src/error.hpp @@ -94,28 +94,28 @@ namespace Exiv2 { provided to print errors to a stream. */ template - class BasicError : public AnyError { + class EXV_DLLPUBLIC BasicError : public AnyError { public: //! @name Creators //@{ //! Constructor taking only an error code - explicit BasicError(int code); + EXV_DLLLOCAL explicit BasicError(int code); //! Constructor taking an error code and one argument template - BasicError(int code, const A& arg1); + EXV_DLLLOCAL BasicError(int code, const A& arg1); //! Constructor taking an error code and two arguments template - BasicError(int code, const A& arg1, const B& arg2); + EXV_DLLLOCAL BasicError(int code, const A& arg1, const B& arg2); //! Constructor taking an error code and three arguments template - BasicError(int code, const A& arg1, const B& arg2, const C& arg3); + EXV_DLLLOCAL BasicError(int code, const A& arg1, const B& arg2, const C& arg3); //! Virtual destructor. (Needed because of throw()) - virtual ~BasicError() throw(); + EXV_DLLLOCAL virtual ~BasicError() throw(); //@} //! @name Accessors //@{ - virtual int code() const throw(); + EXV_DLLLOCAL virtual int code() const throw(); /*! @brief Return the error message as a C-string. The pointer returned by what() is valid only as long as the BasicError object exists. @@ -131,7 +131,7 @@ namespace Exiv2 { private: //! @name Manipulators //@{ - void setMsg(); + EXV_DLLLOCAL void setMsg(); //@} // DATA