Visual Studio 2013 因非静态数据成员初始化而崩溃



我想在Windows 10上用Visual Studio 2013(x86和x64都经过测试)编译Trinitycore

我收到此错误,并测试了所有解决方案,例如:

1.将附加选项上的/Zm 从/Zm500 更改为/Zm2000(最大值)

2.禁用预编译头文件

3.禁用优化

4.re 安装的Visual Studio

5.re 安装视窗 10

Visual Studio 错误说明:

Error   1   error C1001: An internal error has occurred in the compiler.    TrinityCore-3.3.5srcservergameServerWorldSocket.cpp   256 1   game
Error   2   error C1060: compiler is out of heap space  csrcservergamec1xx  game
Error   3   error D8040: error creating or communicating with child process csrcservergamecl    game

事件日志:

Faulting application name: CL.exe, version: 18.0.21005.1, time stamp: 0x524faabf
Faulting module name: c1xx.dll, version: 18.0.21005.1, time stamp: 0x524faa90
Exception code: 0xc0000005
Fault offset: 0x0025236e
Faulting process id: 0x1948
Faulting application start time: 0x01d19f24d391755f
Faulting application path: C:Program Files (x86)Microsoft Visual Studio 12.0VCbinCL.exe
Faulting module path: C:Program Files (x86)Microsoft Visual Studio 12.0VCbinc1xx.dll
Report Id: d98e09ae-0b18-11e6-b361-1008b14a12cc
Faulting package full name: 
Faulting package-relative application ID: 

与输出错误:

TrinityCore-3.3.5srcservergameServerWorldSocket.cpp(256): fatal error C1001: An internal error has occurred in the compiler.
1>  (compiler file 'f:ddvctoolscompilercxxfeslp1cconvert.cpp', line 9608)
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>  Opcodes.cpp
1>c1xx : fatal error C1060: compiler is out of heap space
1>          An internal error has occurred in the compiler.
1>  (compiler file 'msc1.cpp', line 1325)
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>cl : Command line error D8040: error creating or communicating with child process
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

事件日志附件:

Version=1
EventType=APPCRASH
EventTime=131060826745545591
ReportType=2
Consent=1
UploadTime=131060826747020586
ReportIdentifier=e3cb3d99-0b13-11e6-b361-1008b14a12cc
IntegratorReportIdentifier=e3cb3d98-0b13-11e6-b361-1008b14a12cc
WOW64=1
Response.BucketId=d11da6a9b6e3e8a8c8d50161959694bb
Response.BucketTable=1
Response.LegacyBucketId=-389226431
Response.type=4
Sig[0].Name=Application Name
Sig[0].Value=CL.exe
Sig[1].Name=Application Version
Sig[1].Value=18.0.21005.1
Sig[2].Name=Application Timestamp
Sig[2].Value=524faabf
Sig[3].Name=Fault Module Name
Sig[3].Value=c1xx.dll
Sig[4].Name=Fault Module Version
Sig[4].Value=18.0.21005.1
Sig[5].Name=Fault Module Timestamp
Sig[5].Value=524faa90
Sig[6].Name=Exception Code
Sig[6].Value=c0000005
Sig[7].Name=Exception Offset
Sig[7].Value=0025236e
DynamicSig[1].Name=OS Version
DynamicSig[1].Value=10.0.10586.2.0.0.256.48
DynamicSig[2].Name=Locale ID
DynamicSig[2].Value=1033
UI[2]=C:Program Files (x86)Microsoft Visual Studio 12.0VCbinCL.exe
UI[3]=Microsoft (R) C//C++ Optimizing Compiler has stopped working
UI[4]=Windows can check online for a solution to the problem.
UI[5]=Check online for a solution and close the program
UI[6]=Check online for a solution later and close the program
UI[7]=Close the program
LoadedModule[0]=C:Program Files (x86)Microsoft Visual Studio 12.0VCbinCL.exe
LoadedModule[1]=C:WindowsSYSTEM32ntdll.dll
LoadedModule[2]=C:WindowsSYSTEM32KERNEL32.DLL
LoadedModule[3]=C:WindowsSYSTEM32KERNELBASE.dll
LoadedModule[4]=C:Program Files (x86)MSBuild12.0binFileTracker.dll
LoadedModule[5]=C:WindowsSYSTEM32ADVAPI32.dll
LoadedModule[6]=C:WindowsSYSTEM32msvcrt.dll
LoadedModule[7]=C:WindowsSYSTEM32sechost.dll
LoadedModule[8]=C:WindowsSYSTEM32RPCRT4.dll
LoadedModule[9]=C:WindowsSYSTEM32SspiCli.dll
LoadedModule[10]=C:WindowsSYSTEM32CRYPTBASE.dll
LoadedModule[11]=C:WindowsSYSTEM32bcryptPrimitives.dll
LoadedModule[12]=C:WindowsSYSTEM32ole32.dll
LoadedModule[13]=C:WindowsSYSTEM32combase.dll
LoadedModule[14]=C:WindowsSYSTEM32GDI32.dll
LoadedModule[15]=C:WindowsSYSTEM32USER32.dll
LoadedModule[16]=C:WindowsSYSTEM32MSVCR120.dll
LoadedModule[17]=C:Program Files (x86)Microsoft Visual Studio 12.0VCbinmspdb120.dll
LoadedModule[18]=C:WindowsSYSTEM32VERSION.dll
LoadedModule[19]=C:WindowsSYSTEM32IMM32.DLL
LoadedModule[20]=C:WindowsSYSTEM32CRYPTSP.dll
LoadedModule[21]=C:Windowssystem32rsaenh.dll
LoadedModule[22]=C:WindowsSYSTEM32bcrypt.dll
LoadedModule[23]=C:WindowsSYSTEM32MSVCP120.dll
LoadedModule[24]=C:Program Files (x86)Microsoft Visual Studio 12.0VCbinmspdbcore.dll
LoadedModule[25]=C:Program Files (x86)Microsoft Visual Studio 12.0VCbinc2.dll
LoadedModule[26]=C:WindowsSYSTEM32SHLWAPI.dll
LoadedModule[27]=C:Program Files (x86)Microsoft Visual Studio 12.0VCbinc1xx.dll
LoadedModule[28]=C:Windowssystem32apphelp.dll
State[0].Key=Transport.DoneStage1
State[0].Value=1
FriendlyEventName=Stopped working
ConsentKey=APPCRASH
AppName=Microsoft (R) C//C++ Optimizing Compiler
AppPath=C:Program Files (x86)Microsoft Visual Studio 12.0VCbincl.exe
ApplicationIdentity=00000000000000000000000000000000

我真的很困惑,因为我用这个步骤和这个Visual Studio多次编译这个项目。

编辑 1:我创建新的Win32Project,并将以下代码放在上面:

#include "stdafx.h"
# define LENGTH 20
typedef unsigned char      uint8_t;
typedef uint8_t uint8;
struct test
{
    uint8 intT[LENGTH] = {};
};

当我编译时,我再次收到此错误:

Error   1   error C1001: An internal error has occurred in the compiler.    ProjectsWin32Project1Win32Project1Win32Project1.cpp 13  1   Win32Project1

根据定义,"内部编译器错误"(或 ICE)是一个编译器错误。您的程序中很可能有代码触发了该错误。您的崩溃似乎是由使用非静态数据成员初始化(NSDMI)触发的,Microsoft承认他们在Visual Studio 2013中对NSDMI的支持充其量是不可靠的:

不幸的是,我们的编译器中用于处理初始化的代码(其中一些是 30 年前编写的)受到许多长期存在的架构限制。此代码足以进行 C++03 样式的初始化,但 NSDMI(C++11 功能)导致它将这些限制显示为严重的错误。

鉴于此,您可能还希望尝试简单地升级您的工具链。但是,也可能是您的安装完全损坏/损坏。

无论哪种方式,您的第一个任务都是重新安装Visual Studio,并查看问题是否仍然存在。也许尝试在另一台计算机上编译项目。

如果这不能解决它,您需要生成一个最小的测试用例并将其提交给开发人员进行审查(在 MS Connect 上)。请务必回到这里并将我们链接到已发布的问题,以便我可以使用开发人员的任何相关信息(例如修复错误的版本)更新答案。

确定 终于解决了问题,只需要将Visual Studio 2013更新到Visual Studio 2013 Update 5

Visual Studio 2013 更新 5 上,此错误已完全修复。

谢谢"轨道上的轻盈竞赛"和"尼尔"的回答和帮助:)

我真高兴

这是一个

ICE(内部编译器错误)。这是由 WorldSocket.cpp 文件第 256 行周围的代码引起的。

在该文件中;类AuthSession ,这里使用非静态默认成员初始化(NSDMI)和一个数组(在第256行),如错误消息所示。

IIRC,VS2013并不完全支持NSDMI功能。它被添加到C++11中,但VS2013在NSDMI的实施方面存在局限性。

uint8 Digest[SHA_DIGEST_LENGTH] = {};可能太多了,无法编译。

最新更新