I’m using Visual Studio C++ 2008 Express Edition.
Is it possible to modify the text in the Output pane for compilation (or other) errors?
For example, I might receive an error that reads: error C2556: int Class::getResult(void) + a lot more relative garbage.
I can parse the output text and find and fix my mistakes easily. It would still be nice/useful if I could modify the errors to make them cleaner, shorter, and more friendly. An example would be receiving an error that read: “Source.cc (Line 10): Missing a closing;”
It’s pretty easy to take your best shot at this problem. The compiler itself is a command-line program named
cl.exe. If you want to filter its output, what you need to do is create a program that’s also namedcl.exe. It will need to pass all the command line arguments through to the originalcl.exe. Then it’ll take whatever the original one produces as messages on its standard output, parse them, replace them with the messages you prefer, and print those to its own standard output.When you do that, you’ll probably want to at least retain the information about the file and line where the problem occurred in the original format. The IDE parses and uses that to support navigating among errors (e.g., with F4 or double-clicking).