Make sure BasicError<> typeinfo symbol is published in the shared library, provide a test case in exifprint.cpp

v0.27.3
Andreas Huggel 16 years ago
parent 0bc517b545
commit 50d9dce7af

@ -44,7 +44,9 @@ try {
return 0; return 0;
} }
catch (Exiv2::AnyError& e) { //catch (std::exception& e) {
std::cout << "Caught Exiv2 exception '" << e << "'\n"; //catch (Exiv2::AnyError& e) {
catch (Exiv2::Error& e) {
std::cout << "Caught Exiv2 exception '" << e.what() << "'\n";
return -1; return -1;
} }

@ -94,28 +94,28 @@ namespace Exiv2 {
provided to print errors to a stream. provided to print errors to a stream.
*/ */
template<typename charT> template<typename charT>
class BasicError : public AnyError { class EXV_DLLPUBLIC BasicError : public AnyError {
public: public:
//! @name Creators //! @name Creators
//@{ //@{
//! Constructor taking only an error code //! Constructor taking only an error code
explicit BasicError(int code); EXV_DLLLOCAL explicit BasicError(int code);
//! Constructor taking an error code and one argument //! Constructor taking an error code and one argument
template<typename A> template<typename A>
BasicError(int code, const A& arg1); EXV_DLLLOCAL BasicError(int code, const A& arg1);
//! Constructor taking an error code and two arguments //! Constructor taking an error code and two arguments
template<typename A, typename B> template<typename A, typename B>
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 //! Constructor taking an error code and three arguments
template<typename A, typename B, typename C> template<typename A, typename B, typename C>
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 destructor. (Needed because of throw())
virtual ~BasicError() throw(); EXV_DLLLOCAL virtual ~BasicError() throw();
//@} //@}
//! @name Accessors //! @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() @brief Return the error message as a C-string. The pointer returned by what()
is valid only as long as the BasicError object exists. is valid only as long as the BasicError object exists.
@ -131,7 +131,7 @@ namespace Exiv2 {
private: private:
//! @name Manipulators //! @name Manipulators
//@{ //@{
void setMsg(); EXV_DLLLOCAL void setMsg();
//@} //@}
// DATA // DATA

Loading…
Cancel
Save