Visual Studio C 中的环境变量如何/在哪里?项目集?

发布于 2024-12-26 12:13:37 字数 274 浏览 0 评论 0原文

我的项目属性中有很多我不理解的环境变量。单击宏(是否有 Visual Studio 环境变量列表? )给了我一个它们的值的列表,但我无法弄清楚其中一些值的设置位置。 例如,我试图找出变量 $(IntDir) 的设置位置。

什么文件负责设置这些变量?我该如何修改它们?

There a lots of environment variables in my project properties that I do not understand. Clicking on macros (Is there a list of Visual Studio environment variables?) gives me a list of their values, but I am unable to figure out where some of these are set.
For example, I am trying to figure out where the variable $(IntDir) is being set.

What file is responsible for setting these variables? How can I modify them?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

逆蝶 2025-01-02 12:13:37

这些不是环境变量。

它们只是由构建系统定义的宏,您可以使用它们来设置项目的构建属性。它们会自动扩展到目标平台 ($(Platform))、存储项目中间文件的路径 ($(IntDir)) 以及项目名称等内容您的项目 ($(ProjectName))。

您无法直接更改它们,但可以通过修改项目的属性来更改它们。项目文件(创建新项目时由 Visual Studio 自动创建)负责设置它们。

您已经找到了大型列表的链接,即有助于解释它们是什么以及它们做什么。正如文档所述,您可以在项目属性页中接受字符串值的任何位置使用它们。它们使您不必对路径和其他信息进行硬编码,这非常有用。

与环境变量不同,它们不会持续存在,也不会独立于您的构建系统而具有任何含义。一旦你的项目建成,它们就会消失。它们在调试或部署期间不使用。

These are not environment variables.

They're just macros defined by the build system that you can use for setting build properties for your project. They automatically expand to things like the target platform ($(Platform)), the path to store intermediate files for your project ($(IntDir)), and the name of your project ($(ProjectName)).

You can't change them directly, but you can change them by modifying your project's properties. The project file (created automatically by Visual Studio when you create a new project) is responsible for setting them.

You already found a link to the big list of 'em, which is helpful in explaining what they are and what they do. As the documentation says, you can use them anywhere in your project's property pages that string values are accepted. They keep you from having to hard-code paths and other information, which is exceptionally useful.

Unlike environment variables, they do not persist or have any meaning independent of your build system. Once your project has been built, they go away. They're not used during debugging or deployment.

撩发小公举 2025-01-02 12:13:37

如果您想查看特定 VS 实例的“标准”和“自定义”的实际值,请查看此答案 有帮助。 (基本上,您可以使用 Process Explorer 来找出答案。)

.If you want to see actual values for a specific VS instance for both 'standard' and 'custom', see if this answer helps. (Basically, you can use Process Explorer to find that out.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文