cl.exe wrapper in Visual Studio 2008
I created a wrapper in C++ for the cl.exe
(the Visual Studio compiler). To do this, I changed the PATH
environment variable so that Visual Studio finds my cl.exe
first. In my cl.exe
, I then create a process that runs the real cl.exe
with the parameters my cl.exe
got.
The purpose of this is to filter the output from the real cl.exe
to remove warnings that we can't do anything about. We want the "Detect 64-bit Probability Issues" on because it's great, but it spits out a warning.
Warning:
cl : Command line warning D9035 : option 'Wp64' has been deprecated and will be removed in a future release
I have searched for days on how to remove this specific warning, it is not a warning that you can turn off with code or the options like normal warnings.
Problem: Visual Studios run my cl.exe
, then my cl.exe
runs the real cl.exe
, but from then on my cl.exe
doesn't receive the output anymore. I have tested this by making it call something other than the real 开发者_运维百科cl.exe
and my cl.exe
has full control over the output...
Any output from either of the cl.exe
files is displayed in the output box in Visual Studio, but my cl.exe
no longer receives any of the output from the real cl.exe
...
I am using a pipe to handle the output in my cl.exe
, and it works with anything other than the real cl.exe
.
Why doesn't my cl.exe
manage the output? Does Visual Studio forget about my cl.exe
and attach itself to the real one somehow?
Also, is there a solution other than creating a wrapper for the cl.exe
to get rid of this warning?
I have figured it out.
This environment variable from visual studios is used somehow to signal the real cl.exe to send its output to visual studios.
VS_UNICODE_OUTPUT=4209
Clearing this allows my application to handle the output again.
Thanks for your help...!
It looks like you are redirecting the "real" cl.exe
stdout
, but not stderr
. And stderr
is exactly where one would expect compiler warnings to go.
精彩评论