A compilation error of vc6.0: Fatal error c1001: Internal compiler error.

Source: Internet
Author: User

Recently, after compiling a vc6.0 Project (Development Environment: Win2000 + vs6.0 + SP6), the following compilation error message is displayed after the pre-compilation header is added:
C:/program files/Microsoft Visual Studio/vc98/include/xlocnum (106 ):
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
Error executing cl.exe.

There is no problem in compiling every CPP file in the project (except for the CPP file corresponding to the pre-compilation header). It is very strange, so I found it online and found the following solution:

Solve a compilation error in vc6.0

When vc6.0 is used in window98, if the precompiled header file (stdafx. h) contains the header file of the template class, such as the header file of ATL, the compiler reports an error:
Fatal error c1001: Internal compiler Error
(Compiler file 'msc1. cpp ', line 1786)

This problem occurs because the memory allocated by the compiler exceeds the limit.
There are three solutions:
1. Increase the memory limit for the compiler. In project> setting> C/C ++ project option, add the/ZM # NN option, # NN is a number, the maximum value is 2000. The default value is 100. However, this method seems useless.
2. Remove the template header file from stdafx. h;
3. Do not use pre-compiled header files. Project-> setting-> C/C ++: select all. cpp files and use the "Do not use precompiled header files" option. The disadvantage is that compilation is slow.

Http://www.ieasy.org/yuzuo/archives/2005_07.html)

There is also an English one:

I see that while compiling itel. cpp It is trying and failing to open
Debug/iodiary. PCH. I also see that there is no iodiary. cpp. Exactly how is
Iodiary. PCH supposed to be created?

Turn Off precompiled headers for all files in the project, and rebuild. If
The build still fails, then... Uh-oh ..

Modify the project to use the default stdafx. CPP/stdafx. H method of using
PCH. Then, add an empty file stdafx. h and an empty file stdafx. cpp to
Project. Then, for each. cpp file, add as the first line # include
"Stdafx. H". Then compile. This shoshould work. If it does not... Uh-oh.

In order for pre-compiled headers to work properly each. cpp must have
Its first # include statement the name of the one. H (such as stdafx. h) that
Could des all the "actual". H's (Windows. H, stdio. H, etc.) That shoshould be
Supported ded by all. CPPS.

That is the important part. You don't usually want everysingle. H that is
Stored ded in any. cpp in the project to be in stdafx. h -- You do normally
Want windows. H, because it is the big one that can include a lot and is
Usually authorized ded in every. cpp. Putting just windows. h In stdafx. H (and
Removing it from all the. CPPS) can speed up the build tremendously.

Http://www.codecomments.com/archive307-2005-3-421145.html

The following error topics are found in msdn:

* Http://lab.msdn.microsoft.com/productfeedback/SearchResults.aspx? TEXT = fatal + error + c1001 % 3A + internal + compiler + error & stype = 1 & fields = 1 & type = 0 & witid = 0 & pid = 0 & category = 0 & OS = 0 & oslang = 0 & status = 0 & msstatus = 0 & resolution = 0 & chgdays = & Validation = 0 & votes = & voterating = 0 & workarounds = false & attachments = false

* Http://msdn.microsoft.com/library/default.asp? Url =/library/en-US/vccore98/html/c1001.asp

After the pre-compilation is removed, the build is finally run, but it is too slow and depressing ......

Are there any better solutions ?? The same project is put in VC ++. net2003 but the compilation passes smoothly and runs normally .!!!!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.