469,647 Members | 1,769 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,647 developers. It's quick & easy.

Same code build twice => diff binary

Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple console application like void main(){} and 2 times rebuilding the
project gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Viv
Nov 22 '05 #1
4 1974

"Viviana Vc" <vc*******@hotmail.com> wrote in message
news:2i************@uni-berlin.de...
Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple console application like void main(){} and 2 times rebuilding the
project gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Viv


void main(){} is undefined bahaviour therefore the compiler is free to do
what it wants. Vey unlikely this is the cause however. I am not sure about
the format of an exe, but could it be the timestamps that are causing them
to be different?
Allan
Nov 22 '05 #2
I found the following article:
http://support.microsoft.com/default...b;en-us;164151
which tells that indeed the timestamp is the diff, but I couldn't find
in VC++ IDE any setting to disable the timepstamp stuff, and I assume
this should be somehow doable.

Thx,
Viv

On Sat, 05 Jun 2004 14:55:45 +0200, Viviana Vc <vc*******@hotmail.com>
wrote :
Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple console application like void main(){} and 2 times rebuilding the
project gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Viv


Nov 22 '05 #3
Hi, Viviana

depending on settings you can get different timestamps and versions in
binaries. Which will cause different hashes and some other fields - don't
remember now exactly wich ones. If you are really interested - check PE
format description for .Net assemblies on MSDN.

HTH
Alex

"Viviana Vc" <vc*******@hotmail.com> wrote in message
news:2i************@uni-berlin.de...
Hi all,

I am using Win2k, VS. NET 7.1 (MS development Environment 2003 7.1.3088)
and I noticed that by building the exact same code twice the generated
binaries are different (not much, but they are). To be sure I tried a
simple console application like void main(){} and 2 times rebuilding the
project gets 2 different binaries.

Has anybody any clue why this happens?
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?

Thanks in advance,
Viv

Nov 22 '05 #4
Viviana Vc wrote:
I am using Win2k, VS. NET 7.1 (MS development Environment 2003
7.1.3088) and I noticed that by building the exact same code twice the
generated binaries are different (not much, but they are). To be sure
I tried a simple console application like void main(){} and 2 times
rebuilding the project gets 2 different binaries.

Has anybody any clue why this happens?
At least the time-stamp is different.
Could I somehow change a setting or something to remove those diff (I
mean from the same code to get identical binaries)?


In general: No. You can change the timestamp "by hand".
For more info see:
Microsoft Portable Executable and Common Object File Format
Specification
http://www.microsoft.com/whdc/system...re/PECOFF.mspx
It was already discussed several times in some newsgroups; see for
example:
http://groups.google.de/groups?&thre...%40tkmsftngp04
--
Greetings
Jochen

Do you need a memory-leak finder ?
http://www.codeproject.com/tools/leakfinder.asp

Do you need daily reports from your server?
http://sourceforge.net/projects/srvreport/
Nov 22 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Viviana Vc | last post: by
2 posts views Thread by Martin Klaffenboeck | last post: by
9 posts views Thread by Ching-Lung | last post: by
13 posts views Thread by Steven Bethard | last post: by
7 posts views Thread by John Nagle | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.