Template, fatal error C1001: INTERNAL COMPILER ERROR

G

Guest

This gives me a fatal error.
I'm using .NET VC7.1 and made a win32 consol app, I have no problems with
VC6. Debug build.

I have removed nearly all my code this is whats left. From the beginning the
template was defined in a .h file, but that has no effect, same error.

I have seen when searching for fatal error that there are some problems with
templates and optimization, but nothing as simple like this. I'm i doing
something wrong?

#include "stdafx.h"
namespace _DKEYLST
{

template <class Type>
class CMListNode
{
public:
int DeleteNode();
};

};

namespace _DKEYLST
{
template <class Type>
CMListNode<Type>::DeleteNode()
{
return 0;
}
};

class CMyClass
{
public:
CMyClass(){}
};

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

c:\temp\arun\arun\arun.cpp(27) : fatal error C1001: INTERNAL COMPILER ERROR
(compiler file 'msc1.cpp', line 2701)
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more
information
 
C

Carl Daniel [VC++ MVP]

Itjalve said:
#include "stdafx.h"
namespace _DKEYLST
{

template <class Type>
class CMListNode
{
public:
int DeleteNode();
};

};

namespace _DKEYLST
{
template <class Type>
CMListNode<Type>::DeleteNode()

should be

int CMListNode said:
{
return 0;
}
};

class CMyClass
{
public:
CMyClass(){}
};

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

-cd
 
G

Guest

Thank you!

Carl Daniel said:
Itjalve said:
#include "stdafx.h"
namespace _DKEYLST
{

template <class Type>
class CMListNode
{
public:
int DeleteNode();
};

};

namespace _DKEYLST
{
template <class Type>
CMListNode<Type>::DeleteNode()

should be

int CMListNode said:
{
return 0;
}
};

class CMyClass
{
public:
CMyClass(){}
};

int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}

-cd
 

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