"An internal error has occurred in the compiler" in afxtempl.h - by Matthew Pearce

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.

Sign in
to vote
ID 777722 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 1/28/2013 8:42:46 PM
Access Restriction Public


I am trying to compile a project with VS 2012 that compiles successfully with VS 2003 and VS 2008. When compiling in debug, I get an error:

1>  gxtbmgr.cpp
1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxtempl.h(354): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:\dd\vctools\compiler\utc\src\p2\main.c', line 211)
1>   To work around this problem, try simplifying or changing the program near the locations listed above.
1>  Please choose the Technical Support command on the Visual C++ 
1>   Help menu, or open the Technical Support help file for more information
1>  INTERNAL COMPILER ERROR in 'C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe'
1>      Please choose the Technical Support command on the Visual C++
1>      Help menu, or open the Technical Support help file for more information
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\cl.exe"' : return code '0x1'
1>  Stop.
1>NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\nmake.exe"' : return code '0x2'
1>  Stop.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.MakeFile.Targets(38,5): error MSB3073: The command "NMAKE /f grid.mak ogasd" exited with code 2.

The line referenced is the first line of this function:

template<class TYPE, class ARG_TYPE>
CArray<TYPE, ARG_TYPE>::~CArray()

	if (m_pData != NULL)
		for( int i = 0; i < m_nSize; i++ )
			(m_pData + i)->~TYPE();
		delete[] (BYTE*)m_pData;

I can successfully compile in Release, but I need to get a Debug build going. 
Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:29 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Rat1960 on 3/31/2013 at 12:15 PM
I have just purchased Visual Studio 2012 Professional, I am compiling coincidently the same code as Matthew.
The code compiles fine in visual studio 6.0 and visual c++ express 2010 but not Visual Studio 2012
Xiang Fan, Thanks for the #pragma tip
Posted by Xiang [MSFT] on 3/22/2013 at 1:17 PM
Hi Matthew:
    Thanks for reporting the issue.
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.
    You can also workaround the issue by removing the following line in 'OGTest\Src\Grid\_build.h':

#pragma auto_inline( off )

Xiang Fan
Visual C++ Team
Posted by Microsoft on 1/29/2013 at 10:12 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Matthew Pearce on 1/29/2013 at 2:11 PM
Hi, this is in a third party library, but I have managed to strip it down to a minimal project that reproduces the issue. If you open OGTest\Src\grid90.sln and build the configuration "all", you should see the issue occur. Ignore the initial linker error, that wasn't happening in the original project and is unrelated, it is just because I stripped the project down for demonstration purposes.

Additional information: I commented out "ASSERT_VALID" in the included header (for testing what would happen), and the error then occurred on the next instance of "ASSERT_VALID" in that header file.

I am using Version 11.0.51106.01 Update 1.
Posted by Microsoft on 1/29/2013 at 1:07 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. In order to efficiently investigate and reproduce this issue, we are requesting additional information outlined below.

Could you please give us a demo project to demonstrate this issue so that we can conduct further research?

We look forward to hearing from you with this information.

Microsoft Visual Studio Connect Support Team
Posted by Microsoft on 1/28/2013 at 8:50 PM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)