且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

obj 和 bin 文件夹(由 Visual Studio 创建)有什么用?

更新时间:2023-09-26 11:01:28

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.