Different behavoir for Release/Debug build 
Author Message
 Different behavoir for Release/Debug build

For a client/server-program I've built a common dll
for the messaging. Of course should the client and the
server use the same version of this dll.
Because I often forget to increment the version in a construct like
int Currentversion=5;
I use something like
CString DLLDate(__DATE__);
The Client asks the server for his DLLDate ans compares it with
its own. If it is the same - than I assume, that both use the same DLL.

That works fine, but sometimes I test the debug-version of the server
with the release-version of the client.

Sometimes, after I've used the build all-command I have a difference in the
DLLDate
and the release-dll and the debug-dll have nearly the same time.
OK, the dll-date and the string DLLDate should not be the same date (in
fact,
DLLDate is the date of the object-file in which the definition occurs).
What I have:
        release-dll: file-timestamp Oct 22 14:45 and DLLDate is Oct 22
        debug-dll: file-timestamp Oct 22 14:44 and DLLDate is Oct 21

But this difference means, that the debug-mode didn't compile the cpp-file
with
the implementation of DLLDate - but the release-mode did compile it.

And I ask myself why this behavoir?

Any help welcome. Thanks, Holger.



Sat, 09 Apr 2005 21:08:26 GMT  
 Different behavoir for Release/Debug build

Quote:
> But this difference means, that the debug-mode didn't compile the cpp-file
> with
> the implementation of DLLDate - but the release-mode did compile it.

> And I ask myself why this behavoir?

Because nothing changed in that module since the previous release build.
Unless you always do a "rebuild-all", (or at least force the module
containing the date to compile), your scheme isn't guaranteed to work.

One trick (hack) you could do is to make that module depned on a file which
has it's date/time set to a point in the distant future.  Then VC will never
think the corresponding OBJ is up to date and will always compile it.  But
don't do that.

Another trick (hack) you could do is to put a custom build step into the
project which "compiles" some source file (an empty text file) and doesn't
actually produce the output file that it claims to produce.  Instead, it
produces a header which contains the build date, and that header is included
by the date module - so again, it's never up to date.

etc...

There are many ways to accomplish it, but you need a module that's always
compiled in order to get your scheme to work.

HTH

-cd



Sat, 09 Apr 2005 21:18:27 GMT  
 Different behavoir for Release/Debug build
Thanks for the answer. But I use nearly the build-all-command.
But I often recognize, that one file is compiled for debug-mode and not for
release-mode (as with the file with my DLLDate). That I don't understand.
How can I get different release and debug dependencies?

(mayby
#ifdef _DEBUG
#include "whatever.h"
#endif
) - but I don't use this.

Any idea? Thanks, Holger.



Sat, 09 Apr 2005 22:00:41 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Different behavoir Release/Debug-build

2. different results between Debug/Release builds

3. _msize behaviour different in release and debug builds

4. Different return valus in Debug vs Release Build

5. HELP - Different behavior in Release and Debug Builds

6. Debug and release builds have different behavior??

7. Debug build breaks, Release build ok

8. Debug Build vs. Release Build

9. Debug Build works Release build doesn't?

10. Protection Violation in Release Build but not in Debug Build

11. Debug build works correctly but release build doesnt (sometimes)

12. Debug build works, release build crashes!

 

 
Powered by phpBB® Forum Software