Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gcc error message repository

I've spent a lot of time using the Microsoft compiler cl and found that the error codes that it gives in compile messages (like C1234, C5432, etc.) can be very useful. When I get a error I'm unfamiliar with I can easily look it up on MSDN and get a more detailed explanation of what it means.

Now I'm using gcc almost exclusively and I find that I miss that feature. When I get some error in gcc I seem to spend a lot of time googling for the text of the error for information about it. Is there some repository of gcc error messages where each one is explained in more detail?

like image 660
Mike Avatar asked Dec 16 '10 18:12

Mike


1 Answers

I'm not aware of any complete repository including full explanations, but for myself:

  • Over time you'll learn what particular error messages mean (especially in terms of "you're missing a ; but the compiler can't tell").
  • Googling for the constant part of the error message in quotes (not including function names for example) often gives very good explanations in the first 3-5 hits.
  • Template related errors are usually the worst. For those, the compiler gives you two line numbers: The place the template code exists, and the place it's being instantiated. Looking at both lines of code in context can often make things far more clear ("Why is it using THAT overload?"). Sometimes the simplest way is to create a test program with way simpler types to work out what the compiler's telling you (since it won't be helpful enough to show typedefs in the error message).
  • If it's a small piece of code, try it in a different compiler (for example Comeau online) and see if the error is clearer.
like image 138
Mark B Avatar answered Nov 02 '22 03:11

Mark B