obj 和 bin 文件夹(由 Visual Studio 创建)有什么用? [英] What are the obj and bin folders (created by Visual Studio) used for?

查看:23
本文介绍了obj 和 bin 文件夹(由 Visual Studio 创建)有什么用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 Visual Studio 2010 中创建了一个新项目,并注意到我的项目目录中现在有两个名为 objbin 的新文件夹.

I created a new project in Visual Studio 2010 and noticed that there are now two new folders named obj and bin in my project directory.

在构建和调试时会创建一对类似的文件夹 - 这些文件夹是做什么用的?

A similar pair of folders are created when building and debugging - what are these folders for?

推荐答案

obj 文件夹包含对象或中间文件,它们是编译后的二进制文件,没有尚未链接.它们本质上是将被组合以生成最终可执行文件的片段.编译器为每个源文件生成一个目标文件,并将这些文件放入obj 文件夹中.

The obj folder holds object, or intermediate, files, which are compiled binary files that haven't been linked yet. They're essentially fragments that will be combined to produce the final executable. The compiler generates one object file for each source file, and those files are placed into the obj folder.

bin 文件夹包含 二进制文件,它们是您的应用程序或库的实际可执行代码.

The bin folder holds binary files, which are the actual executable code for your application or library.

这些文件夹中的每一个都进一步细分为 DebugRelease 文件夹,它们仅对应于项目的构建配置.上面讨论的两种类型的文件都放置在适当的文件夹中,具体取决于您执行的构建类型.这使您可以轻松确定哪些可执行文件是使用调试符号构建的,哪些是在构建时启用优化并准备发布的.

Each of these folders are further subdivided into Debug and Release folders, which simply correspond to the project's build configurations. The two types of files discussed above are placed into the appropriate folder, depending on which type of build you perform. This makes it easy for you to determine which executables are built with debugging symbols, and which were built with optimizations enabled and ready for release.

请注意,您可以在项目的属性"中更改编译期间 Visual Studio 输出可执行文件的位置.您还可以更改构建配置的名称和所选选项.

Note that you can change where Visual Studio outputs your executable files during a compile in your project's Properties. You can also change the names and selected options for your build configurations.

这篇关于obj 和 bin 文件夹(由 Visual Studio 创建)有什么用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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