在Visual Studio中覆盖环境变量? [英] Environment variable overridden in Visual Studio?

查看:414
本文介绍了在Visual Studio中覆盖环境变量?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用Visual Studio Express 2013并试图编译别人的代码。该文档告诉我在命令行中设置环境变量QTDIR,然后从该终端启动VS。但是编译器仍然认为QTDIR是原来的,而不是我在命令行中指定的。



我已尝试重新启动计算机,然后再次执行,但结果并未更改。我调查了项目属性,但发现似乎没有覆盖这个变量。当我点击对话框中的宏>>按钮,如编辑附加包括目录对话框,它说,QTDIR是什么原来的。 (奇怪:这只发生在解决方案中的一个项目;当我从其他项目打开宏>>,QTDIR是我在命令行中指定!)



所以我想知道是否有东西可以覆盖像Visual Studio这样的环境变量。非常感谢!




  • 编辑:令人困惑的部分是当我查看项目的属性页时, >>用户宏,没有定义。


解决方案

例如您需要删除的项目中有一个用户定义的QTDIR宏。



尝试以下操作:



1)在VS2013中打开你的解决方案



2)打开属性管理器,转到 View>其他Windows>>属性管理器



现在您将看到项目,配置和属性表的层次结构。您需要删除的用户宏将在其中一个属性表(可能是以.user结尾的用户宏)中设置。



3)属性表(一个在时间!),并找到常用属性>>>的QTDIR宏。用户宏。如果有,请选择它并点击删除宏。



希望这有助于!



=http://msdn.microsoft.com/en-us/library/669zx6zc.aspx =nofollow> http://msdn.microsoft.com/en-us/library/669zx6zc.aspx

I'm using Visual Studio Express 2013 and trying to compile someone else's code. The documentation tells me to set the environment variable QTDIR in the command line and then launch VS from that terminal. But the compiler still thinks QTDIR is what it originally was instead of what I specified in the command line.

I've tried to restart the computer and do it again, but the result didn't change. I looked into the project properties, but found nothing that seems to be overriding this variable. And when I clicked the "Macros>>" button in dialogs such as the editing additional include directories dialog, it says QTDIR is what it was originally. (Weirdly: this happens only to one project in the solution; when I opened the Macros>> from other projects, QTDIR is what I specified in the command line!)

So I was wondering if there is something that can override an environment variable like this in Visual Studio. Thanks!

  • Edit: The confusing part is when I looked at the property pages of the projects, under Common Properties >> User Macros and there's nothing defined there.

解决方案

It sounds like there is a user-defined macro for QTDIR in your project that you need to remove.

Try the following:

1) Open your solution in VS2013

2) Open the Property Manager by going to View >> Other Windows >> Property Manager

Now you you'll see a hierarchy of Projects, Configurations, and Property Sheets. The User Macro you need to remove will be set in one of these property sheets (probably the one that ends in .user).

3) Open each property sheet (one at at time!), and find the QTDIR Macro under Common Properties >> User Macros. If it's there, select it and click Remove Macro.

Hope this helps!

Source: http://msdn.microsoft.com/en-us/library/669zx6zc.aspx

这篇关于在Visual Studio中覆盖环境变量?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆