Internal compiler error? 
Author Message
 Internal compiler error?

When I try to compile the following code fragment (see below), the compiler
tells me the following:

Compiling...
TestStaticTemplateMemberFunctions.cpp
TestStaticTemplateMemberFunctions.cpp(45) : fatal error C1001: INTERNAL
COMPILER ERROR
        (compiler file 'msc1.cpp', line 1794)
         Please choose the Technical Support command on the Visual C++
         Help menu, or open the Technical Support help file for more
information
Error executing cl.exe.

TestStaticTemplateMemberFunctions.obj - 1 error(s), 0 warning(s)

Any idea?

Koen

**** start of code ****

// Very simple example showing the use of static member function templates.
// -------------------------------------------------------------------------
-

#include <iostream>
#include <stdlib.h>

using namespace std;

class C
{
public:

 template<class T> static double Mean(const T* inValues,unsigned long
inNumOfValues)
 {
  double Sum = 0;
  unsigned long i = 0;
  for (i = 0; i < inNumOfValues; i++)
   Sum += inValues[i];
  return Sum/inNumOfValues;
 }

 template<class T> static int Compare(const void* inElement1,const void*
inElement2)
 {
  if (*((T*)inElement1) < *((T*)inElement2))
   return -1;
  else if (*((T*)inElement1) > *((T*)inElement2))
   return +1;
  else
   return 0;
 }

Quote:
};

int main(void)
{
 int AInt[] = { 1, 4, 3, 2, 11 };
 float AFloat[] = { 1.0f, 4.0f, 3.0f, 2.0f, 11.0f };
 double ADouble[] = { 1.0, 4.0, 3.0, 2.0, 11.0 };

 cout << C::Mean(AInt,5) << endl;
 cout << C::Mean(AFloat,5) << endl;
 cout << C::Mean(ADouble,5) << endl;

 // Is this also possible somehow?
 qsort(AInt,5,sizeof(int),C::Compare<int>);

 return 0;

Quote:
}



Sat, 26 Mar 2005 19:52:41 GMT  
 Internal compiler error?
Oops! Forgot to mention this is with MSVC++ 6.0 (latest service packs) on
Win2K...


Quote:
> When I try to compile the following code fragment (see below), the
compiler
> tells me the following:



Sat, 26 Mar 2005 19:54:02 GMT  
 Internal compiler error?

Quote:
> When I try to compile the following code fragment (see below), the
compiler
> tells me the following:

> Compiling...
> TestStaticTemplateMemberFunctions.cpp
> TestStaticTemplateMemberFunctions.cpp(45) : fatal error C1001: INTERNAL
> COMPILER ERROR
>         (compiler file 'msc1.cpp', line 1794)
>          Please choose the Technical Support command on the Visual C++
>          Help menu, or open the Technical Support help file for more
> information
> Error executing cl.exe.

This is fixed in VC7 (VS.NET).

-cd



Sat, 26 Mar 2005 21:44:14 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. VC++6.0/SP3 Compiler Error: INTERNAL COMPILER ERROR

2. C1001: INTERNAL COMPILER ERROR (compiler files 'msc1.cpp', line 2844)

3. C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1794)

4. INTERNAL COMPILER ERROR - compiler file 'msc1.cpp', line 1794)

5. fatal error C1001: INTERNAL COMPILER ERROR

6. fatal error C1001: INTERNAL COMPILER ERROR

7. fatal error C1001: INTERNAL COMPILER ERROR

8. fatal error C1001: INTERNAL COMPILER ERROR

9. fatal error C1001: INTERNAL COMPILER ERROR

10. fatal error C1001: INTERNAL COMPILER ERROR

11. fatal error C1001: INTERNAL COMPILER ERROR

12. fatal error C1001: INTERNAL COMPILER ERROR

 

 
Powered by phpBB® Forum Software