Ciao.
Sto incontrando un altro problema in questo porting...
quando il compilatore ( g++ 4.1.3 ) arriva a questa riga (file CEGUICommonFileDialog.cpp) :
codice:
CommonFileDialog::_InstPtr CommonFileDialog::sm_ptr;
mi da errore: " too few template-parameter-lists " .
CommonFileDialog è un typedef, definito alla fine di CEGUICommonFileDialog.h :
codice:
typedef CEGUISingletonX<CCommonFileDialog> CommonFileDialog;
Ho googlato un bel po' ma non sono riuscito a capire esattamente il problema (causa anche della mia inesperienza coi template). Sembra che sia un problema con uno static member. Si riferisce a questa classe (CEGUISingletonX.h) :
codice:
template<class T>
class CEGUISingletonX
{
private:
class _InstPtr
{
public:
_InstPtr() : m_ptr(0) {}
~_InstPtr() { delete m_ptr; }
T* get() { return m_ptr; }
void Set(T* p)
{
if(p!= 0)
{
delete m_ptr;
m_ptr = p;
}
}
private:
T* m_ptr;
};
static _InstPtr sm_ptr;
CEGUISingletonX();
CEGUISingletonX(const CEGUISingletonX&);
CEGUISingletonX& operator=(const CEGUISingletonX&);
public:
static T& getSingleton()
{
if(sm_ptr.get() == 0)
{
sm_ptr.Set(new T());
}
return *sm_ptr.get();
}
static T* getSingletonPtr()
{
if(sm_ptr.get() == 0)
{
sm_ptr.Set(new T());
}
return sm_ptr.get();
}
};
}
dove sono dichiarati _InstPtr e sm_ptr;
Non so più dove sbattere la testa sinceramente : )