Link to home
Start Free TrialLog in
Avatar of sumsumsum
sumsumsum

asked on

Release Mode and Debug Mode

I am building a program with the MS Visual C++ 6.0. At the beginning, I build the project in the release mode it can compile without errors and works correctly. But when I change it into Debug mode the program also compile correctly but it prefoem illegal operations and  when I try to do the "Debug" the complier told me that it stop at some when in the dissambly program. What's wrong? How can I deal with it?
Avatar of freshmeat
freshmeat

interesting, i want to know the answer, too
a debug version often does many additional checks for errors that are not done in a release version.  These checks are to help the programmer detect problems in the code--that is why it is called a debug version.  Unfortunately, this makes the debug version run slower and take up more space than release version.  so when you have debuged the program, you should create a release version for the end user to use.

Other than that, I cannot tell you any more about what the problem is without more details from you.  Like where does the error occur? what file? what line?  Have you included debug information in the debug version of the project?  Are you running the project under the VC debugger?
Hi,
 The Debug version initializes the uninitialized vars etc. It additionally checks for the memory leaks. SO if your program is not memory tight, that is there are memory leaks or pointer mismanagement (VC automatically puts 0xcdcdcd to invalid pointers) then ptr->Value gives assertions. So the Debug version problems has to be correctly resolved for a good app.

Hope others add to this info. I am sure its not complete.

Bye
Abdij
You need to find the point in your code that initiated the exception in Windows.

I do this by opening up the Variable window (View -> Debug Window -> Variables) and pressing the Context combo box down arrow. Find a reference to your code.

To verify that this is the problem, set a break point where the reference is and rerun the program in debug mode. Press step over and see if the problem occurs. Next examine the parameters that you are passing to the function are they valid?

Good Luck,
Steve
Hi,
 If your app is in Debug Build, then when an exception occurs it automatically starts the VC++ (Visual Studio). There in the Context List you can know where exactly your code has failed.
Abdij
>> then when an exception occurs it
>> automatically starts the VC++ (Visual Studio)
Only if just-in-time debugging is installed and if VC is the default debugger.
ASKER CERTIFIED SOLUTION
Avatar of yodan
yodan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
sumsumsum, are you out there?  
Hi Man,

 Repeating Nietod . Are you there???????????????????????????????

Bye
Abdij