Is there a way to remove duplicate errors from the Error List in Visual Studio 2010?
When I compile my (legacy) C++ code, I get the same error multiple times in header files, each time it is imported in a different file. This is truly the same error being reported multiple times. Is there a way to view only the dis开发者_如何学JAVAtinct errors in the error list?
Thank you.
I wouldn't use the error list to prioritise hundreds/thousands of errors, I'd use the output window.
Reasons:
The output window shows all the errors, in their actiual context. The error list (or TFS build logs for that matter) often show errors in confusing orders, or miss errors entirely (For example, if a post-build step fails, you'll probably get "0 errors 0 warnings" reported in the error list when the output window reports "5 projects successfully built, 2 failed". In my book a project that fails to build is an error, and most definitely something that shouldn't be quietly swept under the carpet! Conclusion: The error list is simply too unreliable for use in a production environment)
You can save/copy the output window text into a new text file, filter out only the errors, sort them and remove duplicates very easily (by any number of regex, command line, GUI, addin or macro approaches). If you are intending to do a build and then sift through the results to prioritise fixes, the expense of doing this is easily paid back in the time saved in your subsequent "sifting" jobs.
On the other hand, consider not bothering to "prioritise". Typically the errors that are repeated a lot in header files will be among the most trivial fixes, so you can spend a few hours eliminating them to vastly reduce the "spam" in your build and then cut to the chase on the more difficult issues. This is often a more time-efficient approach than trying to filter them away to deal with later.
Like everyone else has said, fix the errors.
WHen i use dable i the word of c++, sometimes you break your project and you get a zillion errors, what i would do is the following.
1) Build Project.
2) Look for the FIRST ERROR it reports.
3) Fix that Error.
4) Goto 1.
The reason for this is that sometimes 1 error can make alot of other errors come up, so fixing them in order of them being reported was smart.
精彩评论