Differences between debug and release versions

Source: Internet
Author: User
I have summarized some debugging and release problems.
In VC, when the entire project is large, the software is often in the release state that can run in the debug state.
. Developers usually develop software in the debug state.
It took us one or two months of hard work to prepare and release the software with confidence. To avoid unnecessary issues
We 'd better perform the following checks:
1. Often test the two software versions.
 
2. Do not easily attribute the problem to debug/release unless you have fully implemented the two versions.
Test.
 
3. Differences in Preprocessing may also cause such problems.
One possibility of a problem is that different pre-processing tags are defined during compilation of different versions. Please
Try the following changes in the debug version:
 
Set the directory (Category) to "General ",
And changed "_ debug" to "ndebug ".
Set the directory to "Preprocessor" and add definition "_ debug to" undefined symbols "input box.

Select rebuild all and recompile.
If a problem occurs in the compiled program, make the following changes to the Code:
 
Change assert () to verify ().
Find the code defined in "# ifdef _ debug ".
Are moved out of the definition.
Find the code in trace (...) because the code is not compiled in release.
Therefore, please carefully check whether the Code required in the release is not cheap.
 
4. variables are stored in different systems or between debug/release versions.
In this case, initialize the variable.
 
5. Is there a warning during compilation? Set the warning level to 3 or 4, and make sure there is no
Warning appears.
 
6. Whether the resource file has been changed.
 
7. You can also debug the software of the release version. Make the following changes:
 
In "Project Settings", "C ++/C", set "category" to "general" and
Set "debug info" to "program database ".
Select the "Generate debug info" check box under the "Link" project.
"Rebuild all"
Some restrictions arising from this practice:
 
The value of the variable in the mfc dll cannot be obtained.
You must modify the symbols input box for all DLL projects used by the software.

Select rebuild all and recompile.
If a problem occurs in the compiled program, make the following changes to the Code:
 
Change assert () to verify ().
Find the code defined in "# ifdef _ debug ".
Are moved out of the definition.
Find the code in trace (...) because the code is not compiled in release.
Therefore, please carefully check whether the Code required in the release is not cheap.
 
4. variables are stored in different systems or between debug/release versions.
In this case, initialize the variable.
 
5. Is there a warning during compilation? Set the warning level to 3 or 4, and make sure there is no
Warning appears.
 
6. Whether the resource file has been changed.
 
7. You can also debug the software of the release version. Make the following changes:
 
In "Project Settings", "C ++/C", set "category" to "general" and
Set "debug info" to "program database ".
Select the "Generate debug info" check box under the "Link" project.
"Rebuild all"
Some restrictions arising from this practice:
 
The value of the variable in the mfc dll cannot be obtained.
All DLL projects used by the software must be modified.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.