STLFilt is well worth the few mins of hassle to get set up.
Printable View
STLFilt is well worth the few mins of hassle to get set up.
The key skill for template errors, on any compiler, is wading through the useless noise to find the helpful information. Usually it's right at the beginning and/or right at the end of a given error...and the line number is often the most useful part, as has been said. You should see some of the errors you can end up with while trying to use boost::variant.....two pages of output for a 1-character typo, at times. (I'm hoping that C++0x variadic templates will allow the library maintainers to provide a simpler implementation which doesn't spew such massive errors.)
I actually have come across a few that I've had to look up recently. I think one was about "undefined reference to vtable for Class", which basically amounted to something like "you forgot to give the destructor a definition".
Seriously, how hard would it be to add an expert system to an IDE which could intelligently suggest what might be the cause of a given error?
I think that feature is concepts, and not variadic templates.Quote:
I'm hoping that C++0x variadic templates will allow the library maintainers to provide a simpler implementation which doesn't spew such massive errors
I still argue that intelligent compiler should have error codes.Quote:
Seriously, how hard would it be to add an expert system to an IDE which could intelligently suggest what might be the cause of a given error?
In general yes, but if you'd seen the boost::variant errors I have you'd know what I was talking about. Massive types with like 20 template parameters, most of which are called "unused" or something.....
Couldn't hurt, but a true expert system would go far enough beyond that as to make them redundant. It would have processing such as:Quote:
I still argue that intelligent compiler should have error codes.
1) Function is an unresolved external symbol.
2) Is there a function with the same name defined?
3A) Yes -> There might be a parameter/qualifier mismatch between a function declaration on line N and the definition on line M?
3B) No -> Is there a function with a similar name defined?
3Ba) Yes -> There might be a typo in the function declaration on line N or the definition on line M?
etc.
About gcc not giving good error messages or error count: that is Dev-C++ not revealing them, not gcc failing to give them. Code::Blocks gives you more output. Also, You said you're working with GCC 3.2? O.o Use 4.2 if you are on Mac or 4.4 if you are on PC/Linux.
Why do you want an error code? GCC gives you an the error in plain english, as well as the exact line that the error occurs on.