简体   繁体   中英

In Visual Studio 2013 using a custom compiler (makefile project) how do I get VS to parse the warnings

I am using MSVS2013.

I have setup a custom makefile C++ project that essentially calls a batch file that I wrote to invoke my compiler.

The output of my compiler creates warnings in the format:

>>> Warning <code> "c:\\some\\file\\path\\somefile.h" Line <num>(x,y): warning comment

or

>>> Warning <code> "somefile.c" Line <num>(x,y): warning comment

Note: The second one does not have the whole path, just the filename (not sure why), but the file is in the project source files list - so it should know about it.

When I double click the warning line visual studio does not open the file on that line. I am assuming that this is becuause it does not understand the syntax of the warning line to parse it.

So my question is how can I get MSVS2013 to parse the warning correctly?

In the end it was easiest to write a little bit of awk script to solve this (which can be applied to any compiler). My knowledge of awk is not so good so I did spend quite a lot of time trying to figure it out - ended up post another question to help complete it, so see the link below (the answer) for a decent implementation that is easy to modify for any compiler output:

gawk script answer here

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM