Release vs. Debug mode builds

This is a discussion on Release vs. Debug mode builds within the C++ Programming forums, part of the General Programming Boards category; Hi, I ran into a very peculiar problem with my project. If I build it in debug mode and run ...

  1. #1
    Registered User
    Join Date
    May 2005
    Location
    Toronto, Canada
    Posts
    257

    Release vs. Debug mode builds

    Hi,

    I ran into a very peculiar problem with my project. If I build it in debug mode and run the .exe from the debug folder I get the following output with this line:
    [code]
    fprintf(out, "%d %s %s %s%c", DD.vectWords[i].Bits[j].Bit,
    DD.vectWords[i].Bits[j].WarMsg,
    DD.vectWords[i].Bits[j].Destination,
    DD.vectWords[i].Bits[j].Type, c);
    Code:
     
    output:
    11 "take off" CAS WARNING

    Which is what it's supposed to be. If I build in Release and run the .exe fro mthe Release file the same line of code produces this:
    Code:
    125634
    34
    .
    3545
    Or some other gibrish. I couldn't find any info about the modes and I don't know this well enough.
    Does anyone else know and could tell me how to fix this and what/why's happening, please?

    Thanks

    Edit: I forgot to mention that I run Windows NT and MS Visual C++ 6.0
    Last edited by earth_angel; 11-10-2005 at 02:05 PM.
    Everything is relative...

  2. #2
    Bioport Productions
    Join Date
    Oct 2005
    Posts
    215
    ??????
    -"What we wish, we readily believe, and what we ourselves think, we imagine others think also."
    PHP Code:
    sadf 

  3. #3
    Registered User
    Join Date
    May 2005
    Location
    Toronto, Canada
    Posts
    257
    Well, if the problem can't be fixed is it oKif my application is built in Debud configuration? The users will just use the .exe fiel and just run the application.
    Everything is relative...

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    I believe Microsoft doesn't allow you to give Debug builds to customers. Besides, the fact that it doesn't work in the Release build means there is a bug, and that bug might seriously corrupt the user's data under different circumstances even in the Debug build.

    Make sure that i and j are initialized and are within the bounds of the array/vector. Debug builds often initialize uninitialized variables to 0, which might be why it works.

  5. #5
    Registered User
    Join Date
    May 2005
    Location
    Toronto, Canada
    Posts
    257
    That goes through a double for loop of the following form:
    Code:
    for (j=0; j<19; j++)
    and they are used earlier in the function.
    Everything is relative...

  6. #6
    Registered User
    Join Date
    Jan 2005
    Posts
    7,340
    And the Bits array/vector has 19 elements? If its a vector, write out its size to verify, and do the same with vectWords. I'm just grasping at straws, there are many different possible reasons.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Results in Debug and Release mode are different
    By jaro in forum C Programming
    Replies: 11
    Last Post: 05-27-2006, 11:08 AM
  2. release vs debug mode
    By bithub in forum Tech Board
    Replies: 2
    Last Post: 05-10-2006, 03:31 PM
  3. Debug Mode Vs. Release Mode
    By incognito in forum Tech Board
    Replies: 5
    Last Post: 12-18-2003, 03:06 PM
  4. 2min in debug mode, 3sec in release!
    By glUser3f in forum C++ Programming
    Replies: 9
    Last Post: 10-03-2003, 01:00 PM
  5. Differences in Debug and Release builds in MSVC
    By TravisS in forum C Programming
    Replies: 5
    Last Post: 06-19-2002, 10:40 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21