fatal error C1001: INTERNAL COMPILER ERROR (compiler file 'msc1.cpp', line 1794)

放肆的年华 提交于 2019-12-22 10:29:54

问题


I tried to compile a project with Visual Studio 6 SP6 and got the following:

usbcore.h(18) : fatal error C1001: INTERNAL COMPILER ERROR
    (compiler file 'msc1.cpp', line 1794)
     Please choose the Technical Support command on the Visual C++
     Help menu, or open the Technical Support help file for more information

Line 18 of usbcore.h contains the include directive:

18: #include "usbiface.h"

Empty or non-existing usbiface.h produces the same error. I commented this line and got the same error but for the next include file.

To sum this up: the compiler error occurs for each #include directive that refers to the common project headers.


回答1:


In my case, changing the tag WholeProgramOptimizationtrue from true to false fixed the problem.




回答2:


I figured out what caused that error. One of the include paths (passed to a compiler with the /I switch) had a trailing backslash.

The compiler cmdline is: CPP /nologo /MT /W3 /GX /Zi /Od /I "$(ZLIB_PATH)" /I "..\headers"

and ZLIB_PATH had a trailing backshlash. Removing that backslash solved the problem.




回答3:


I ran into this problem when I left the parenthesis off of the definition of a ctor. It was a stupid error but it was very taxing to check out all of these tough fixes. So I just offer this as a possibility. I would not have expected an internal compiler error.




回答4:


In my case (VC6.0 SP6a), it is due to the confusing using statement. It seems the compiler can't determine whether I'm defining Foo::Bar or Bar (in global namespace).

namespace Foo {
    class Bar;
}

using Foo::Bar;

class Bar {
};


来源:https://stackoverflow.com/questions/17451978/fatal-error-c1001-internal-compiler-error-compiler-file-msc1-cpp-line-1794

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!