每次需要构建任何内容时强制重建文件 [英] Force to rebuild a file every time anything needs to be built

查看:85
本文介绍了每次需要构建任何内容时强制重建文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我的目标是在需要构建时始终编译x.cpp。我试图使用pre-build选项删除x.obj,希望VS然后重建文件。虽然步骤删除x.obj罚款,但构建过程不会编译x.cpp(假设VS已经计算出在调用预构建步骤之前需要构建的内容,我是
),因此链接器抱怨x.obj丢失,所以构建只是每隔一次成功。

My goal is to always compile x.cpp whenever something requires building. I've tried to use the pre-build option to delete x.obj in the hope that VS would then rebuild the file. While the step deletes x.obj fine, the build process doesn't compile x.cpp (I'm assuming VS has already worked out what needs to be built before invoking the pre-build step), so the linker complains that x.obj is missing, So the build succeeds only every second time.


还有另一种技巧可以实现吗?

Is there another trick to accomplish this?


感谢提前任何帮助!

Thanks for any help in advance!

推荐答案

尝试将 del 命令添加到Post-Build Event选项。

Try adding the del command to Post-Build Event options.


这篇关于每次需要构建任何内容时强制重建文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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