﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Design&amp;Art-随笔分类-VC/MFC</title><link>http://www.cppblog.com/abware/category/4441.html</link><description /><language>zh-cn</language><lastBuildDate>Thu, 22 May 2008 14:49:40 GMT</lastBuildDate><pubDate>Thu, 22 May 2008 14:49:40 GMT</pubDate><ttl>60</ttl><item><title>[ZZ]VC中调试Release版本程序</title><link>http://www.cppblog.com/abware/archive/2007/09/05/31634.html</link><dc:creator>安帛伟</dc:creator><author>安帛伟</author><pubDate>Wed, 05 Sep 2007 09:33:00 GMT</pubDate><guid>http://www.cppblog.com/abware/archive/2007/09/05/31634.html</guid><wfw:comment>http://www.cppblog.com/abware/comments/31634.html</wfw:comment><comments>http://www.cppblog.com/abware/archive/2007/09/05/31634.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/abware/comments/commentRss/31634.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/abware/services/trackbacks/31634.html</trackback:ping><description><![CDATA[<span style="FONT-FAMILY: 宋体; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=3><strong><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span><span lang=EN-US>VC6.0</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中调试</span><span lang=EN-US>Release</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">版本程序</span></strong></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size=3>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font size=3>有两种方法：</font></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.75pt; TEXT-INDENT: -21.75pt; mso-list: l1 level1 lfo1; tab-stops: list 21.75pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>1. </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在怀疑有错误的地方加</span><span lang=EN-US>MessageBox</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">，在函数中显示可能导致错误的变量的值。或者插入写文件语句。输出可能导致错误的变量的值到一个记录文件。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size=3>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.75pt; TEXT-INDENT: -21.75pt; mso-list: l1 level1 lfo1; tab-stops: list 21.75pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>2. </font></span></span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'"><font size=3>在工程中设置</font></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l1 level2 lfo1; tab-stops: list 42.0pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>① </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span><span lang=EN-US>&#8221;Project Settings&#8221;</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">里选</span><span lang=EN-US>Setting For </span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">为</span> <span lang=EN-US>All Configurations</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l1 level2 lfo1; tab-stops: list 42.0pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>② </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span><span lang=EN-US>C/C++</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标签中&#8220;</span><span lang=EN-US>Debug Info</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;选</span> <span lang=EN-US>Program Database</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 42pt; TEXT-INDENT: -21pt; mso-list: l1 level2 lfo1; tab-stops: list 42.0pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>③ </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span><span lang=EN-US>link</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">标签中&#8220;</span><span lang=EN-US>Category</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;选中&#8220;</span><span lang=EN-US>Debug Info</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;复选框和&#8220;</span><span lang=EN-US>Microsoft Format</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21pt"><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">现在就可以像在调试</span><span lang=EN-US>Debug</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中那样设置断点进行调试了。由于代码优化，有些变量观察不到，行的运行顺序也可能不同。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size=3>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><font size=3><strong><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在</span><span lang=EN-US>VS2005</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">中调试</span><span lang=EN-US>Release</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">版本的程序</span></strong></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><span lang=EN-US><o:p><font size=3>&nbsp;</font></o:p></span></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.75pt; TEXT-INDENT: -21.75pt; mso-list: l0 level1 lfo2; tab-stops: list 21.75pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>1. </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">在工程的属性设置中，&#8220;链接&#8221;——</span><span lang=EN-US>&gt;</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;调试&#8221;——</span><span lang=EN-US>&gt;</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;生成调试信息&#8221;，选择&#8220;</span> <span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">是</span> <span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.75pt; TEXT-INDENT: -21.75pt; mso-list: l0 level1 lfo2; tab-stops: list 21.75pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>2. </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;</span><span lang=EN-US>C/C++</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;——</span><span lang=EN-US>&gt;</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;常规&#8221;——</span><span lang=EN-US>&gt;</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;调试信息形式&#8221;，选择</span> <span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;</span><span lang=EN-US>/ZI</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;。</span></font></p>
<p class=MsoNormal style="MARGIN: 0cm 0cm 0pt 21.75pt; TEXT-INDENT: -21.75pt; mso-list: l0 level1 lfo2; tab-stops: list 21.75pt"><span lang=EN-US style="mso-fareast-font-family: 'Times New Roman'"><span style="mso-list: Ignore"><font size=3>3. </font></span></span><font size=3><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;</span><span lang=EN-US>C/C++</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8221;——</span><span lang=EN-US>&gt;</span><span style="FONT-FAMILY: SimSun; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'">&#8220;优化&#8221;，设置&#8220;禁用&#8221;。</span></font></p>
</span>
<img src ="http://www.cppblog.com/abware/aggbug/31634.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/abware/" target="_blank">安帛伟</a> 2007-09-05 17:33 <a href="http://www.cppblog.com/abware/archive/2007/09/05/31634.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>lines   ending   with   only   a   carriage   return   have   been   detected. </title><link>http://www.cppblog.com/abware/archive/2007/06/06/25665.html</link><dc:creator>安帛伟</dc:creator><author>安帛伟</author><pubDate>Wed, 06 Jun 2007 08:45:00 GMT</pubDate><guid>http://www.cppblog.com/abware/archive/2007/06/06/25665.html</guid><wfw:comment>http://www.cppblog.com/abware/comments/25665.html</wfw:comment><comments>http://www.cppblog.com/abware/archive/2007/06/06/25665.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/abware/comments/commentRss/25665.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/abware/services/trackbacks/25665.html</trackback:ping><description><![CDATA[VC6打开一个文件时，提示如下错误：<br>lines &nbsp; ending &nbsp; with &nbsp; only &nbsp; a &nbsp; carriage &nbsp; return &nbsp; have &nbsp; been &nbsp; detected. &nbsp; These &nbsp; will &nbsp; be &nbsp; modified &nbsp; to &nbsp; include &nbsp; a &nbsp; line &nbsp; feed. <br><br>在对该文件进行单步调试时，实际执行的代码与看到的错开了一行，很是郁闷。用Source Insight和UltraEdit对该文件进行编辑和保存，仍不能解决问题。<br><br>上网搜索了一下，发现是如下原因：<br>&#8220;有两种流行的ascII文件格式，一种是msdos，一种是unix。msdos的ascII文件的换行处用0x0d &nbsp; 0x0a两个ascII表示，但unix下用0x0a表示。VC的编译器采用msdos方式的ascII文件，所以当他遇到unix的ascII文件格式时会向你报警。&#8221;<br><br>解决方法：<br>在VC6里编辑一下该文件，再保存时VC6就会修复该问题。
<img src ="http://www.cppblog.com/abware/aggbug/25665.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/abware/" target="_blank">安帛伟</a> 2007-06-06 16:45 <a href="http://www.cppblog.com/abware/archive/2007/06/06/25665.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>