When building an application in Visual Studio. It shows the following error when exceeding the error count
fatal error C1003: error count exceeds 100; stopping compilation
Is there a way to increase the error开发者_如何学JAVA limit?
This limitation is hardcoded. Here is the post from the MSFT employee in the microsoft.public.vsnet.general
group dated 2006 (look for 'Fatal Error C1003'):
Hi,
Unfortunately this 100 limitation is hard coded and cannot be changed. It's just inpractical to keep all errors information around since one error may cause other several errors.
I hope you understand the rational behind this design by our product team. However, if you still have concerns about this, please feel free to submit your feedback at
http://connect.microsoft.com/Main/content/content.aspx?ContentID=2220 which is monitored by our product team. Thank you for your understanding.Sincerely, Walter Wang (waw...@online.microsoft.com, remove 'online.') Microsoft Online Community Support"
I don't think so. VS basically reports all errors it encounters during compilations. There might be some erroneous parts of the code that make the compiler getting caught in an infinite "error" loop.
The limit was implemented to avoid that. In most cases the 100 errors you get are just the same error reported over and over again. What would be the sense in increasing the number of repetitions?
Maybe you can post the code snippet where the error occurs first, so we can help you fix it.
I believe that it is a hard-coded limit, so no.
As others have commented, it's difficult to understand what you want to achieve by this.
At the end of the day, you'll have to fix them all, so get stuck in and start fixing them. Eventually, you'll get below 100, and you can start counting them.
It is not normally valuable to report the actual number of errors when this occurs. Most of the time, when you get C1003, it's actually only a few real errors, leading to a massive chain of other errors.
(e.g.)
- If there is an error in a .h file, that error will be reported in every .cpp file that
#includes
it. - If there is an error that prevents any kind of identifier being defined (e.g. a class, variable, method name), then every time you try to use it later on, an error will be reported.
Workaround to reduce number of reported errors:
- rename cl.exe to cl-orig.exe
- roll your own cl.exe that launches cl-orig.exe, capturing its stdout / stderr
- parse stderr, looking for error messages and counting them
- breaks after first n errors
See http://msdn.microsoft.com/en-us/library/ms682499(v=vs.85).aspx for some hints.
I also have a project like this: sometimes Visual Studio decides there is a lot to do, emits 100 really irrelevant messages about other parts of the solution and aborts the build because it reached the message limit without working on the project I'm interested on.
The workaround we have found is to use msbuild to build the solution from a command prompt: the Use MSBuild walkthrough outlines the steps. msbuild outputs all messages to the console and once the build completes we can work and debug again in Visual Studio. Not ideal, but it lets us complete the task at hand.
精彩评论