Trevor Sundberg
Trevor Sundberg

Reputation: 1684

GCC output MSVC style errors

Is there a compiler flag that makes GCC output errors in MSVC style?

GCC Style Error:

C:\Sandbox\MyFile.cpp:98:15: error: ...

MSVC Style Error:

C:\Sandbox\MyFile.cpp(15): error CXXXX: ...

I don't care about the error numbers (CXXXX) being the same, so much as the line number being in the format of (##):, without the character number. The reason I want this is that I'm using Visual Studio to launch a Scons GCC build, and I love the fact that it outputs the errors in Visual Studio's Output console, however, when I double click the error it only takes me to the file, but not the line that the error occurred (hence it needs to be in the MSVC format).

I could always redirect the output from Scons, parse it myself and change any errors, but I'd like to avoid that if it's as simple as setting a GCC flag.

Upvotes: 0

Views: 575

Answers (1)

Timo Geusch
Timo Geusch

Reputation: 24351

I'm pretty sure there isn't a way to convince GCC to pretend its error messages are coming from MSVC. You'd probably have to create a little filter script or program that just removes the unwanted character offsets and wrap that around your Scons build. Or use a different IDE/Editor that can handle both styles of output.

Upvotes: 2

Related Questions