Why building the same project generates different EXE file for each developer
Asked Answered
C

5

12

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.

Cronk answered 15/1, 2010 at 8:10 Comment(1)
I assume that you're asking about the release version, right?Selfregard
S
5

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

Selfregard answered 15/1, 2010 at 8:25 Comment(4)
it's just a guess. Incremental linking adds some debug info every time you build the project. It doesn't create a clean exe.Selfregard
I'll check it on Sunday. Thank you.Cronk
D: Thank you! Rebuild All by all developers did generate the same EXE (except from time tag differences).Cronk
@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.Selfregard
M
4

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?).

Mathias answered 15/1, 2010 at 8:20 Comment(0)
S
3

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.

Stavro answered 15/1, 2010 at 8:51 Comment(0)
W
1

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).

Wandering answered 15/1, 2010 at 8:22 Comment(0)
U
0

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

Unchurch answered 15/1, 2010 at 8:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.