Package: fbdesk Severity: normal Tags: patch When building 'fbdesk' on amd64 with gcc-4.0, I get the following error:
g++ -DHAVE_CONFIG_H -I. -I. -I.. -IFbTk -g -O2 -I/usr/include/libpng12 -c -o fbdesk-FbDesk.o `test -f FbDesk.cc || echo './'`FbDesk.cc Resource.hh: In constructor 'Resource<T>::Resource(ResourceManager&, T, const std::string&, const std::string&)': Resource.hh:74: error: invalid use of undefined type 'struct ResourceManager' Resource.hh:59: error: forward declaration of 'struct ResourceManager' Resource.hh: In destructor 'virtual Resource<T>::~Resource()': Resource.hh:77: error: invalid use of undefined type 'struct ResourceManager' Resource.hh:59: error: forward declaration of 'struct ResourceManager' make[4]: *** [fbdesk-FbDesk.o] Error 1 make[4]: Leaving directory `/fbdesk-1.1.5/src' With the attached patch 'fbdesk' can be compiled on amd64 using gcc-4.0. Regards Andreas Jochens diff -urN ../tmp-orig/fbdesk-1.1.5/src/Resource.hh ./src/Resource.hh --- ../tmp-orig/fbdesk-1.1.5/src/Resource.hh 2003-01-14 22:45:53.000000000 +0100 +++ ./src/Resource.hh 2005-03-19 21:44:34.252512284 +0100 @@ -56,41 +56,9 @@ std::string m_altname; ///< alternative name }; +template<typename T> class Resource; class ResourceManager; -/** - Real resource class -*/ -template <typename T> -class Resource:public Resource_base -{ -public: - Resource(ResourceManager &rm, T val, - const std::string &name, const std::string &altname): - Resource_base(name, altname), - m_value(val), m_defaultval(val), - m_rm(rm) - { - m_rm.addResource(*this); // add this to resource handler - } - virtual ~Resource() { - m_rm.removeResource(*this); // remove this from resource handler - } - - inline void setDefaultValue() { m_value = m_defaultval; } - void setFromString(const char *strval); - inline Resource<T>& operator = (const T& newvalue) { m_value = newvalue; return *this;} - - std::string getString(); - inline T& operator*() { return m_value; } - inline const T& operator*() const { return m_value; } - inline T *operator->() { return &m_value; } - inline const T *operator->() const { return &m_value; } -private: - T m_value, m_defaultval; - ResourceManager &m_rm; -}; - class ResourceManager { public: @@ -129,4 +97,37 @@ ResourceList m_resourcelist; }; +/** + Real resource class +*/ +template <typename T> +class Resource:public Resource_base +{ +public: + Resource(ResourceManager &rm, T val, + const std::string &name, const std::string &altname): + Resource_base(name, altname), + m_value(val), m_defaultval(val), + m_rm(rm) + { + m_rm.addResource(*this); // add this to resource handler + } + virtual ~Resource() { + m_rm.removeResource(*this); // remove this from resource handler + } + + inline void setDefaultValue() { m_value = m_defaultval; } + void setFromString(const char *strval); + inline Resource<T>& operator = (const T& newvalue) { m_value = newvalue; return *this;} + + std::string getString(); + inline T& operator*() { return m_value; } + inline const T& operator*() const { return m_value; } + inline T *operator->() { return &m_value; } + inline const T *operator->() const { return &m_value; } +private: + T m_value, m_defaultval; + ResourceManager &m_rm; +}; + #endif //_RESOURCE_HH_ -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]