OK, now that I'm back from holiday I've had another look at it and found at least one bug that leads to the errors. * Jorge Almeida (j-almeida@criticalsoftware.com) [20051221 17:06]:
/usr/local/lib/libccext2.so: undefined reference to `__gnu_cxx::__exchange_and_add(int volatile*, int)' /usr/local/lib/libccext2.so: undefined reference to
Are you shure that version of libccext2.so was linked against the same libstdc++ as on your system? These
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:205: error: ‘c’ was not declared in this scope
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:233: error: ‘c’ was not declared in this scope
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:290: error: there are no arguments to ‘top’ that depend on a template parameter, so a declaration of ‘top’ must be available
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:318: error: there are no arguments to ‘size’ that depend on a template parameter, so a declaration of ‘size’ must be available
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:319: error: there are no arguments to ‘pop’ that depend on a template parameter, so a declaration of ‘pop’ must be available
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:348: error: ‘c’ was not declared in this scope
/home/jorge/cvs_critical/marinha/direccao-navios/sistemas-mice/implementation/smice/./common/linux/queues/CMiceQueue.h:376: error: ‘c’ was not declared in this scope
All these are called from within template functions but are not dependent on a template parameter, just as the compiler tells you. This is one of the cases where the compiler got more standard conforming and thus rejects the code. So what you have to do is make these template dependent by accessing them via the this pointer. Here is a patch for Template.h that does just this and also contains two other unrelated fixes: a) include cerrno instead of errno.h b) *NEVER* pull symbols into the global namespace in a header! This is OK for normal source files but headers should not do this as it makes namespaces useless Have fun Philipp --- Template.h.old 2006-01-02 17:01:10.992116161 +0100 +++ Template.h 2006-01-02 16:49:12.329953305 +0100 @@ -1,19 +1,15 @@ - #ifndef _CMICEQUEUE_H_ #define _CMICEQUEUE_H_ #include <semaphore.h> #include <vector> #include <queue> -#include <errno.h> +#include <cerrno> #include <cc++/thread.h> #include "CTime.h" #include "CEthernetMessage.h" -using namespace std; -using namespace ost; - template <class T> class CMiceQueue : protected std::priority_queue<T, std::vector<T>, std::greater<T> > { @@ -73,44 +69,44 @@ template <class T> void CMiceQueue<T>::Reserve(size_t un_size) { - c.reserve(un_size); + this->c.reserve(un_size); } template <class T> void CMiceQueue<T>::Clear(void) { - c.clear(); + this->c.clear(); } template <class T> void CMiceQueue<T>::Push(const T& rt_arg) { - push(rt_arg); + this->push(rt_arg); } template <class T> const T& CMiceQueue<T>::Top(void) const { - return top(); + return this->top(); } template <class T> void CMiceQueue<T>::Pop(void) { - if (size() > 0) { - pop(); + if (this->size() > 0) { + this->pop(); } } template <class T> bool CMiceQueue<T>::Empty(void) const { - return c.empty(); + return this->c.empty(); } template <class T> size_t CMiceQueue<T>::Size(void) const { - return c.size(); + return this->c.size(); }