From: Helmut J. <jar...@ig...> - 2009-02-05 11:29:25
|
Hi, I'm trying to compile vpython (CVS from today) but my gcc-4.3.3 bails out : ../include/platlinux.h:27: error: declaration of 'typedef class visual::lock<visual::mutex> visual::mutex::lock' ../include/vthread.h:13: error: changes meaning of 'lock' from 'class visual::lock<visual::mutex>' It doesn't seem possible to redefine 'lock' Here a simple test case #include <pthread.h> template <class syncObject> class lock { private: syncObject& obj; public: lock(syncObject& _obj) : obj(_obj) { _obj.sync_lock(); } ~lock() { obj.sync_unlock(); } private: // not implemented by design, to be noncopyable lock(const lock&); void operator=(const lock&); }; class mutex { int count; pthread_mutex_t mtx; public: typedef lock<mutex> lock; }; Has anybody solved that problem (perhaps by changing one of the definitions of 'lock' to 'Lock' ) ? Many thanks for a hint, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany |