致命错误C1001:在编译器中发生了内部错误。

时间:2022-11-05 19:55:29

While compiling on x64 plattform I am getting following error:

在x64 plattform上编译时,我得到以下错误:

c:\codavs05\hpsw-sc\ovpacc\tools\codaaccesstest\coda_access.cpp(1572): fatal error C1001: An internal error has occurred in the compiler.

(compiler file 'f:\dd\vctools\compiler\utc\src\p2\sizeopt.c', line 55)
To work around this problem, try simplifying or changing the program near the locations listed above.
Please choose the Technical Support command on the Visual C++
Help menu, or open the Technical Support help file for more information

------ Build started: Project: asyncexample, Configuration: Release Win32 ------

If I change settings to preprocessor file (Yes) i am not getting any error.

如果我将设置更改为预处理器文件(是的),我不会有任何错误。

About my environment: Upgrading Microsoft Visual Studio 2005 to 2010

关于我的环境:升级微软Visual Studio 2005到2010

Please help.

请帮助。

11 个解决方案

#1


8  

I’ve encountered this error many times in VC++. Do the following steps. They’ve always helped me with this issue:

我在vc++中多次遇到这个错误。做下面的步骤。他们总是在这个问题上帮助我:

  1. Take a look at the exact location, pointed out by compiler error.
  2. 看看准确的位置,由编译器错误指出。
  3. Find any external types or classes used there at that location.
  4. 找到在该位置使用的任何外部类型或类。
  5. Change the order of “include path” of those files found in step 2 and rebuild the solution.
  6. 更改步骤2中发现的文件“包含路径”的顺序,并重新构建解决方案。
  7. I hope that help !!!!
  8. 我希望这能帮上忙!!!

#2


6  

I am getting same error with VC2012. Setting up the project properties Optimization to Disabled (/Od) resolved the issue.

我在VC2012上也有同样的错误。将项目属性优化设置为禁用(/Od)解决了这个问题。

#3


3  

In my solution, i've removed output dll file of the project, and I've made project rebuild.

在我的解决方案中,我删除了项目的输出dll文件,并进行了项目重建。

#4


3  

I have had this problem with VS2015 while building locally in Windows.

我在VS2015的时候遇到过这个问题,而在Windows中本地构建。

In order to solve it, I deleted my build folder (Output Directory as seen in Properties/General) and rebuilt the project.

为了解决这个问题,我删除了我的build文件夹(在Properties/General中看到的输出目录)并重新构建了这个项目。

This always seems to help when strange things happen during the build.

在构建过程中发生奇怪的事情时,这似乎总是有帮助的。

#5


2  

I encountered the same error and spent quite a bit of time hunting for the problem. Finally I discovered that function that the error was pointing to had an infinite while loop. Fixed that and the error went away.

我遇到了同样的错误,花了相当多的时间寻找问题。最后我发现这个错误指向的函数有一个无限的while循环。修正后,错误就消失了。

#6


2  

In my case was the use of a static lambda function with a QStringList argument. If I commented the regions where the QStringList was used the file compiled, otherwise the compiler reported the C1001 error. Changing the lambda function to non-static solved the problem (obviously other options could have been to use a global function within an anonymous namespace or a static private method of the class).

在我的例子中,使用了带有QStringList参数的静态lambda函数。如果我注释了QStringList使用文件编译的区域,否则编译器会报告C1001错误。将lambda函数更改为非静态解决了这个问题(显然,其他选项可以是在匿名名称空间中使用全局函数或类的静态私有方法)。

#7


1  

I also had this problem while upgrading from VS2008 to VS2010.

我在从VS2008升级到VS2010时也遇到了这个问题。

To fix, I have to install a VS2008 patch (KB976656).

为了修复,我必须安装一个VS2008补丁(KB976656)。

Maybe there is a similar patch for VS2005 ?

也许VS2005也有类似的补丁?

#8


1  

I got the same error, but with a different file referenced in the error message, on a VS 2015 / x64 / Win7 build. In my case the file was main.cpp. Fixing it for me was as easy as doing a rebuild all (and finding something else to do while the million plus lines of code got processed).

我得到了相同的错误,但是在VS 2015 / x64 / Win7构建中,错误消息中引用了不同的文件。在我的案例中,文件是main.cpp。对我来说,修复它就像重新构建所有代码一样简单(并且在处理上百万行代码的同时找到其他的事情)。

Update: it turns out the root cause is my hard drive is failing. After other symptoms prompted me to run chkdsk, I discovered that most of the bad sectors that were replaced were in .obj, .pdb, and other compiler-generated files.

更新:原来根本原因是我的硬盘坏了。在其他症状促使我运行chkdsk之后,我发现大多数被替换的坏扇区都在.obj、.pdb和其他编译器生成的文件中。

#9


1  

I got this one with code during refactoring with a lack of care (and with templates, it case that was what made an ICE rather than a normal compile time error)

我在重构过程中不小心地使用了代码(而在模板中,这是导致ICE而不是正常编译时错误的原因)

Simplified code:

简化代码:

void myFunction() {
    using std::is_same_v;
    for (auto i ...) {
       myOtherFunction(..., i);
    }
}

void myOtherFunction(..., size_t idx) {
    // no statement using std::is_same_v;
    if constexpr (is_same_v<T, char>) {
        ...
    }
}

#10


1  

I got this error using boost library with VS2017. Cleaning the solution and rebuilding it, solved the problem.

我在使用VS2017的boost库时犯了这个错误。清理并重建解决方案,解决了问题。

#11


0  

I had this error when I was compiling to a x64 target. Changing to x86 let me compile the program.

我在编译到x64目标时犯了这个错误。修改为x86让我编译这个程序。

#1


8  

I’ve encountered this error many times in VC++. Do the following steps. They’ve always helped me with this issue:

我在vc++中多次遇到这个错误。做下面的步骤。他们总是在这个问题上帮助我:

  1. Take a look at the exact location, pointed out by compiler error.
  2. 看看准确的位置,由编译器错误指出。
  3. Find any external types or classes used there at that location.
  4. 找到在该位置使用的任何外部类型或类。
  5. Change the order of “include path” of those files found in step 2 and rebuild the solution.
  6. 更改步骤2中发现的文件“包含路径”的顺序,并重新构建解决方案。
  7. I hope that help !!!!
  8. 我希望这能帮上忙!!!

#2


6  

I am getting same error with VC2012. Setting up the project properties Optimization to Disabled (/Od) resolved the issue.

我在VC2012上也有同样的错误。将项目属性优化设置为禁用(/Od)解决了这个问题。

#3


3  

In my solution, i've removed output dll file of the project, and I've made project rebuild.

在我的解决方案中,我删除了项目的输出dll文件,并进行了项目重建。

#4


3  

I have had this problem with VS2015 while building locally in Windows.

我在VS2015的时候遇到过这个问题,而在Windows中本地构建。

In order to solve it, I deleted my build folder (Output Directory as seen in Properties/General) and rebuilt the project.

为了解决这个问题,我删除了我的build文件夹(在Properties/General中看到的输出目录)并重新构建了这个项目。

This always seems to help when strange things happen during the build.

在构建过程中发生奇怪的事情时,这似乎总是有帮助的。

#5


2  

I encountered the same error and spent quite a bit of time hunting for the problem. Finally I discovered that function that the error was pointing to had an infinite while loop. Fixed that and the error went away.

我遇到了同样的错误,花了相当多的时间寻找问题。最后我发现这个错误指向的函数有一个无限的while循环。修正后,错误就消失了。

#6


2  

In my case was the use of a static lambda function with a QStringList argument. If I commented the regions where the QStringList was used the file compiled, otherwise the compiler reported the C1001 error. Changing the lambda function to non-static solved the problem (obviously other options could have been to use a global function within an anonymous namespace or a static private method of the class).

在我的例子中,使用了带有QStringList参数的静态lambda函数。如果我注释了QStringList使用文件编译的区域,否则编译器会报告C1001错误。将lambda函数更改为非静态解决了这个问题(显然,其他选项可以是在匿名名称空间中使用全局函数或类的静态私有方法)。

#7


1  

I also had this problem while upgrading from VS2008 to VS2010.

我在从VS2008升级到VS2010时也遇到了这个问题。

To fix, I have to install a VS2008 patch (KB976656).

为了修复,我必须安装一个VS2008补丁(KB976656)。

Maybe there is a similar patch for VS2005 ?

也许VS2005也有类似的补丁?

#8


1  

I got the same error, but with a different file referenced in the error message, on a VS 2015 / x64 / Win7 build. In my case the file was main.cpp. Fixing it for me was as easy as doing a rebuild all (and finding something else to do while the million plus lines of code got processed).

我得到了相同的错误,但是在VS 2015 / x64 / Win7构建中,错误消息中引用了不同的文件。在我的案例中,文件是main.cpp。对我来说,修复它就像重新构建所有代码一样简单(并且在处理上百万行代码的同时找到其他的事情)。

Update: it turns out the root cause is my hard drive is failing. After other symptoms prompted me to run chkdsk, I discovered that most of the bad sectors that were replaced were in .obj, .pdb, and other compiler-generated files.

更新:原来根本原因是我的硬盘坏了。在其他症状促使我运行chkdsk之后,我发现大多数被替换的坏扇区都在.obj、.pdb和其他编译器生成的文件中。

#9


1  

I got this one with code during refactoring with a lack of care (and with templates, it case that was what made an ICE rather than a normal compile time error)

我在重构过程中不小心地使用了代码(而在模板中,这是导致ICE而不是正常编译时错误的原因)

Simplified code:

简化代码:

void myFunction() {
    using std::is_same_v;
    for (auto i ...) {
       myOtherFunction(..., i);
    }
}

void myOtherFunction(..., size_t idx) {
    // no statement using std::is_same_v;
    if constexpr (is_same_v<T, char>) {
        ...
    }
}

#10


1  

I got this error using boost library with VS2017. Cleaning the solution and rebuilding it, solved the problem.

我在使用VS2017的boost库时犯了这个错误。清理并重建解决方案,解决了问题。

#11


0  

I had this error when I was compiling to a x64 target. Changing to x86 let me compile the program.

我在编译到x64目标时犯了这个错误。修改为x86让我编译这个程序。