如何始终使用Eclipse编译cpp文件? [英] How to always compile a cpp file with Eclipse?
问题描述
我在我的一个cpp源文件中包含了一个unix时间戳 __ DATE __
,表示我的程序的生成日期。当然,使用默认设置,它只有当我改变它,但现在我想让它总是编译文件。我试图搜索项目设置,但似乎这将需要更深入的了解编译器。我使用Eclipse和g ++。
I have included a unix timestamp __DATE__
in one of my cpp source files to indicate the build date of my program. Naturally with default setups it compiles the file only when I change it but now I'd like to have it always compiled. I tried to search through the project settings but it seems that this would need deeper understanding of the compiler. I'm using Eclipse with g++.
我试图google并搜索一个答案,但我发现很难找到这个关键字。
I tried to google and search for an answer but I found it difficult to find good keywords for this.
还有一个可标记的差异,我做这个更改头文件而不是源文件?
Also is there a markable difference wether I do this change for a header file instead of the source file?
感谢您的答案。
推荐答案
您可以创建一个预构建步骤,触摸文件(因此时间戳已修改,并强制重新编译该文件)。
You may create a 'pre-build' step which touch the file (so the time stamp is modified and force to recompile the file).
这篇关于如何始终使用Eclipse编译cpp文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!