VC ++中需要.Obj文件? [英] .Obj file required in the VC++?

查看:335
本文介绍了VC ++中需要.Obj文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是VC ++和MFC的新手,我正在使用VC在MFC中创建一个应用程序。我发现当我构建项目时,它会在调试文件夹中为.cpp文件创建.obj文件。



现在我的问题是当我正在部署这个时项目我需要包含此.obj文件?因为我发现即使我删除.obj文件并运行exe仍然有效。因此,在向其他电脑使用时需要包含它。



如果在调试模式和发布模式下构建项目,则另一个问题是obj文件大小不同这是正常的吗?



任何人都可以帮我解决这两个问题吗?



提前致谢

解决方案

不,你不需要它来执行应用程序。它是一个中间对象文件,由链接器用于生成可执行文件。通常的做法是为中间文件指定一个与输出目录不同的目录,以便更清晰,更容易地进行清理和部署操作。



此外,在DEBUG中编译时,目标文件将更大,因为它包含所需的调试信息。我确定你会在进行更多开发工作时发现更多相关内容。



问候,

Ian。

I am new in VC++ and MFC, I am creating one application in the MFC with VC. I found that when I build the project it create the .obj file for .cpp file in the debug folder.

Now my question is when I am doing deployment of this project I require to include this .obj file? because I found that even if I remove the .obj file and run the exe still it is working. so at time of deplyoment to other pc it is require to include it.

And another question is obj file size is different if build project in debug mode and release mode so is it normal ?

Can any one help me on these two question ?

Thanks in advance.

解决方案

No you don''t need it for executing the application. It is an intermediary object file, used by the linker to make the executable. It is common practice to specify a directory for the intermediary files that is different from the output directory, in order to make clean-up and deployment operations clearer and easier.

Also, the object file will be larger when compiled in DEBUG because it contains the required debug information. I''m sure you will find out more about that as you do more development work.

Regards,
Ian.


这篇关于VC ++中需要.Obj文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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