C2300 error : 'System::Enum' : class does not have a destructor called '~TYPE'

K

Karine Pinault

I am having trouble trying to compile existing code with the /clr
flag.

The following error occurs and I can't figure it out how to fix this
problem.

I have the following declaration:
typedef enum t_enEtatListeAuto
{
enEtatAucun,
enEtatCoche,
enEtatCroix
};

This type is then used in a CList:
CList<t_enEtatListeAuto,t_enEtatListeAuto> m_oListeDesEtats;

The following compile error occurs:

C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\atlmfc\include\afxtempl.h(864) : error C2300: 'System::Enum'
: class does not have a destructor called '~TYPE'
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xmemory(136) : while compiling class-template member
function 'void CList<TYPE,ARG_TYPE>::RemoveAll(void)'
with
[
TYPE=t_enEtatListeAuto,
ARG_TYPE=t_enEtatListeAuto
]
C:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\xmemory(136) : while compiling class-template member
function 'CList<TYPE,ARG_TYPE>::~CList(void)'
with
[
TYPE=t_enEtatListeAuto,
ARG_TYPE=t_enEtatListeAuto
]
STY_Ctl_Liste.h(110) : see reference to class template
instantiation 'CList<TYPE,ARG_TYPE>' being compiled
with
[
TYPE=t_enEtatListeAuto,
ARG_TYPE=t_enEtatListeAuto
]


Any help would be appreciated.

Karine
 
M

MasterChief

Hy!

I think you have to make the following line to your cpp file of the List:
// explizite Instanzierung:
template class CList< t_enEtatListeAuto>;
Just add this at the beginning of the cpp file.

Hope this helps!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top