Visual Studio 2008 中的 cl.exe 包装器
我用 C++ 为 cl.exe(Visual Studio 编译器)创建了一个包装器。为此,我更改了 PATH
环境变量,以便 Visual Studio 首先找到我的 cl.exe
。然后,在我的 cl.exe
中,我创建一个进程,使用我的 cl.exe
获得的参数运行真正的 cl.exe
。
这样做的目的是过滤真实的 cl.exe 的输出,以删除我们无能为力的警告。我们希望启用“检测 64 位概率问题”,因为它很棒,但它会发出警告。
警告:
cl:命令行警告 D9035:选项“Wp64”已被弃用,并将在未来版本中删除
我已经搜索了几天有关如何删除此特定警告的信息,它不是您可以使用代码或正常警告等选项关闭。
问题:Visual Studio 运行我的 cl.exe
,然后我的 cl.exe
运行真正的 cl.exe
,但从那时起我的 cl.exe 不再收到输出。我已经通过让它调用除真正的 cl.exe 之外的其他东西来测试这一点,并且我的 cl.exe 可以完全控制输出
... cl.exe
文件显示在 Visual Studio 的输出框中,但我的 cl.exe
不再接收真实 cl.exe< 的任何输出/code>...
我正在使用管道来处理我的输出cl.exe
,它可以与真正的cl.exe
以外的任何东西一起使用。
为什么我的 cl.exe
不管理输出? Visual Studio 是否会忘记我的 cl.exe 并以某种方式将其自身附加到真实的 cl.exe 上?
另外,除了为 cl.exe 创建包装器来消除此警告之外,还有其他解决方案吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我已经想通了。
Visual Studio 中的这个环境变量以某种方式用于向真正的 cl.exe 发出信号,将其输出发送到 Visual Studio。
VS_UNICODE_OUTPUT=4209
清除此选项允许我的应用程序再次处理输出。
感谢您的帮助...!
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...!
看起来您正在重定向“真实的”
cl.exe
stdout
,但不是stderr
。stderr
正是人们期望编译器警告出现的地方。It looks like you are redirecting the "real"
cl.exe
stdout
, but notstderr
. Andstderr
is exactly where one would expect compiler warnings to go.