Thread: VS2010 C++/CLI Bug

  1. #1
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130

    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...
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Did you do "make clean" after turning off PCH?

    Is there a bug list / known issues on MSDN?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    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.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  4. #4
    'Allo, 'Allo, Allo
    Join Date
    Apr 2008
    Posts
    639
    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)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. MSVC 2005 bug?
    By VirtualAce in forum C++ Programming
    Replies: 4
    Last Post: 01-10-2010, 11:55 AM
  2. Disappearing Bug
    By el-sid in forum C++ Programming
    Replies: 4
    Last Post: 08-16-2009, 12:12 PM
  3. gaks bug?
    By Yarin in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 08-31-2008, 02:47 PM
  4. Debugging a rare / unreproducible bug..
    By g4j31a5 in forum A Brief History of Cprogramming.com
    Replies: 18
    Last Post: 08-05-2008, 12:56 PM
  5. ATL bug of CComPtr?
    By George2 in forum Windows Programming
    Replies: 6
    Last Post: 04-07-2008, 07:52 AM