Output compile time stamp in Visual C++ executable?

前端 未结 6 904
借酒劲吻你
借酒劲吻你 2021-01-04 02:08

How can I insert compilation timestamp information into an executable I build with Visual C++ 2005? I want to be able to output something like this when I execute the progra

6条回答
  •  醉梦人生
    2021-01-04 03:01

    I think, the suggested solutions to use DATE, TIME or TIMESTAMP would be good enough. I do recommend to get a hold of a touch program to include in a pre-build step in order to touch the file that holds the use of the preprocessor variable. Touching a file makes sure, that its timestamp is newer than at the time it was last compiled. That way, the date/time in the compiled file is changed as well with each rebuild.

提交回复
热议问题