views:

231

answers:

5

My team and I are developing a VC++ 6 project. We are all using the same code-base (using version control system), and all our compiler/linker/environment-settings (including include directories order), as far as we can tell, are exactly the same. Of course we are using the same VC++ version with the same service packs (VC6 SP6).

The problem is that the EXE that each one of us build is a little bit different.

I know that every time you build an EXE on the same computer, there are 3 locations in the file where the linker stores a time-stamp. I'm not talking about these differences.

Though our EXE files are exactly the same length, when we compare the EXEs, there are 1000's of bytes that differs. Many of those bytes differs by 0x20 in value.

Any idea what may be the reason?

Edit: Debug build (Actually, We didn't check the release).

Edit: The differences are in binary sections, not in text-strings.

Edit: All of the developers are using the same drive/folder names, for source and for products.

A: 

Just a guess: uninitialized parts of strings or string properties of a certain length where the #0 is not at the end ?

Edelcom
+4  A: 

Since 0x20 is the difference between upper and lower case ASCII characters I wonder if these differences happen to be in file paths that the compiler/linker embed in the binary (assert messages perhaps?). Could your dev trees be different ("C:\DevTrees\MyProject\SuperFoo" on one box and "E:\work\projects\superfoo" on another?).

Michael Burr
+1  A: 

It might be coincidence, but 0x20 is the difference between the values of lower-case and upper-case ASCII characters (eg 'A' == 65 == 0x41, 'a' == 97 = 0x61).

AakashM
+3  A: 

If Debug version has the option "Link incrementally" checked, then probably it's the reason for the diffs.

Nick D
Can you please elaborate?
Lior Kogan
it's just a guess. Incremental linking adds some debug info every time you build the project. It doesn't create a *clean* exe.
Nick D
I'll check it on Sunday. Thank you.
Lior Kogan
@Nick D: Thank you! Rebuild All by all developers did generate the same EXE (except from time tag differences).
Lior Kogan
@Lior, yes, Rebuild All creates a clean EXE. I should have mentioned it. So, that was indeed the problem? I'm glad I could help. Cheers.
Nick D
+3  A: 

I agree with what NickD says. During debug, incremental linking is on which doesn't rebuild the exe from scratch, but appends/inserts/removes code here and there for each build.

I.e. the layout of the exe depends on every compilation since the first.

A clean build should yield identical results on identical compilers.

Marcus Lindblom