25

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 limit?

15
  • 9
    just curious, why would you want to do that?
    – jaywon
    May 21, 2010 at 9:33
  • 13
    I don't know if it's possible or not, but may I ask you about your motivation? Do you get more than 100 meaningful error messages?
    – avakar
    May 21, 2010 at 9:33
  • 2
    @Oleksii Skidan, then maybe the question you should be asking is "how do I list the functions declared in a header and used by my program".
    – avakar
    May 21, 2010 at 9:56
  • 4
    @Okeksii: it's such a "normal and fast" approach that the compiler doesn't support it? GCC does the same thing. The problem is that every time it encounters an error, the compiler has to guess at what was probably meant, in order to keep compiling. If it has to keep guessing, it ends up compiling completely made-up code, and then you get errors that have nothing to do with your actual code. That is why it stops after a certain number of errors. As @avakar said, you're going about this the wrong way.
    – jalf
    May 21, 2010 at 10:43
  • 10
    Here is a reason for this: I want to upgrade a large project to UNICODE. I have been fixing errors for 50 hours at this point, and I want to know if there is any hope of finishing. All the errors are meaningful, and I just need to gauge the scope.
    – Knyphe
    Mar 18, 2011 at 22:56

5 Answers 5

29
+25

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 ([email protected], remove 'online.') Microsoft Online Community Support"

7

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.

0
4

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.
1
  • 1
    @ Paul Butcher Eg if you have 3 projects and two depend on a class library then the two can be throwing a zillion errors due to the library but you can't get to the library errors due to the limit. That's where I am right now and it's a pain. Even if you only compile the library, the other two projects' errors get in the way.
    – SteveCinq
    Dec 4, 2017 at 3:26
4

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.

1

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.