-
VS2010 C++/CLI Bug
Description:
Open a new CLR Console project. In the main cpp file, insert a function, that it looks like this:
Code:
// fatalconsole.cpp : main project file.
#include "stdafx.h"
using namespace System;
/// NEW FUNCTION:
void ErrorOnCompile()
{
const wchar_t* text = L"";
String^ s = gcnew String( text );
}
// END NEW FUNCTION
int main(array<System::String ^> ^args)
{
Console::WriteLine(L"Hello World");
return 0;
}
Compile in Debug mode. Should compile just fine. Turn of precompiled headers in the options. Compile again. It should bomb with a "fatal error C1001: internal compiler error". Anyone ever encountered this? Is there a hotfix or something available? I've been googling for some time now, but could not find anything related...
-
Did you do "make clean" after turning off PCH?
Is there a bug list / known issues on MSDN?
-
I did a "Clean Solution" and "Rebuild All". I also spent countless hours yesterday on the real project, trying to make it work with any kind of way to convert a const char* to something else to maybe not have it crash, but even the most complicated ways failed. Strangely, removing the pointer and putting L"" into the String constructor directly works fine.
I'm just browsing through the 300+ bugreports on Microsoft Connect containing my error, but as it's fairly general ("something failed") I'll probably be browsing for a while :)
This guy seems to have hit the same error, but probably found another solution.
-
FWIW Just installed VS2010 pro from dreamspark and it works fine here from a default CLR console project (with both frameworks 2.0 and 4)