﻿<?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++博客-曲凡的C/C＋＋程序生活-文章分类-VC开发</title><link>http://www.cppblog.com/jetqu2003/category/7201.html</link><description>软件人生</description><language>zh-cn</language><lastBuildDate>Sat, 06 Sep 2008 11:55:10 GMT</lastBuildDate><pubDate>Sat, 06 Sep 2008 11:55:10 GMT</pubDate><ttl>60</ttl><item><title>makefile 学习详解（转）</title><link>http://www.cppblog.com/jetqu2003/articles/60833.html</link><dc:creator>relaxqu</dc:creator><author>relaxqu</author><pubDate>Wed, 03 Sep 2008 09:51:00 GMT</pubDate><guid>http://www.cppblog.com/jetqu2003/articles/60833.html</guid><wfw:comment>http://www.cppblog.com/jetqu2003/comments/60833.html</wfw:comment><comments>http://www.cppblog.com/jetqu2003/articles/60833.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/jetqu2003/comments/commentRss/60833.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/jetqu2003/services/trackbacks/60833.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: 概述——什么是makefile？或许很多Winodws的程序员都不知道这个东西，因为那些Windows的IDE都为你做了这个工作，但我觉得要作一个好的和professional的程序员，makefile还是要懂。这就好像现在有这么多的HTML的编辑器，但如果你想成为一个专业人士，你还是要了解HTML的标识的含义。特别在Unix下的软件编译，你就不能不自己写makefile了，会不会写makef...&nbsp;&nbsp;<a href='http://www.cppblog.com/jetqu2003/articles/60833.html'>阅读全文</a><img src ="http://www.cppblog.com/jetqu2003/aggbug/60833.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/jetqu2003/" target="_blank">relaxqu</a> 2008-09-03 17:51 <a href="http://www.cppblog.com/jetqu2003/articles/60833.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>关于在未安装VS2005的机器上调用C++程序</title><link>http://www.cppblog.com/jetqu2003/articles/59220.html</link><dc:creator>relaxqu</dc:creator><author>relaxqu</author><pubDate>Mon, 18 Aug 2008 06:42:00 GMT</pubDate><guid>http://www.cppblog.com/jetqu2003/articles/59220.html</guid><wfw:comment>http://www.cppblog.com/jetqu2003/comments/59220.html</wfw:comment><comments>http://www.cppblog.com/jetqu2003/articles/59220.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/jetqu2003/comments/commentRss/59220.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/jetqu2003/services/trackbacks/59220.html</trackback:ping><description><![CDATA[<p><strong>一、问题及解决方法如下：</strong></p>
<p><strong>1. 问题描述：</strong><br><br>最近在VS2005下用C++写了一个Console程序，在一台未安装VS2005的机器上不能正常运行。<br>用命令行方式运行，提示：<br>&#8220;系统无法执行指定的程序&#8221;<br>直接双击运行，提示：<br>&#8220;由于应用程序的配置不正确，应用程序未能启动，重新安装应用程序可能会纠正这个问题&#8221;<br><br>用VC6和VS2003也有这个问题，只不过会提示说找不到&#8220;***.dll&#8221;，把需要的dll拷贝到目标机器就可以正常运行了。而VS2005并没有提示缺少哪些dll。<br><br><strong>2. 解决方案：</strong><br><br>在水木C++版请教了一下，ass做出了回答（非常感谢ass的帮助）。把他的回答摘录如下，大家共同学习：<br><br>&#8220;因为没有msvcr80.dll<br>可以改一下编译选项 多线程dll(/MD)改成多线程(MT)这样就静态链接，<br>也可以从你的vc8安装盘上找到再分发包vcredist_xxx.exe和你的程序捆绑安装。&#8221;<br><br>根据ass指导的思路，自己实验了一下，感觉以下两种解决办法是比较方便的：<br><br><strong>方法一：</strong><br>在C:Program FilesMicrosoft Visual Studio 8VCredi<br>stDebug_NonRedistx86Microsoft.VC80.DebugCRT 下找到了下列文件：<br><br>msvcm80d.dll<br>msvcp80d.dll<br>msvcr80d.dll<br>Microsoft.VC80.DebugCRT.manifest<br><br>把这几个文件拷贝到目标机器上，与运行程序同一文件夹或放到system32下，就可以运行那个程序了。<br><br><strong>方法二：</strong><br>项目属性-》配置属性修改&#8220;C/C++/Code Generation&#8221;中的运行时库选项，将/MD或/MDd 改为 /MT或/MTd，这样就实现了对VC运行时库的静态链接，在运行时就不再需要VC的dll了。</p>
<p>上面为转载</p>
<p>下面为新添加</p>
<p><strong><u>二、vs2005、vs2008程序发布的方法：</u></strong> <br><br>alt+F7-&gt;配置属性-&gt;C/C++-&gt;Code Generation-&gt;Runtime Library 属性一般在发布的时候要进行静态发布，因为目前的操作系统正在换代，平台比较多，所以debug：Multi-threaded Debug(MTd)、release：Multi-threaded(MT),当然如果工程里边需要依赖很多的dll，每个dll又不一定是静态发布，尤其是MFC extension DLL,必须为动态发布这时工程里肯定要包含MFC的运行库，所以这好似所有的工程就可以采用动态运行库的方法，debug：Multi-threaded Debug DLL(MDd)、release：Multi-threaded DLL(MD)，这时可以采用共享MFC库的方式即alt+F7-&gt;配置属性-&gt;General-&gt;Project Defaults-&gt;Use of MFC-&gt;use mfc in a shared dll <br>vs2005 <br>Debug 发行版 所依赖的库为：mfc80d.dll、Microsoft.VC80.DebugMFC.manifest、Microsoft.VC80.DebugMFC.manifest、msvcm80d.dll、msvcp80d.dll、msvcr80d.dll <br>Release 发布版 所依赖的库为：mfc80.dll、Microsoft.VC80.MFC.manifest、Microsoft.VC80.MFC.manifest、msvcm80.dll、msvcp80.dll、msvcr80.dll <br><br>vs2008 <br>Debug 发行版 所依赖的库为：mfc90d.dll、Microsoft.VC90.DebugMFC.manifest、Microsoft.VC90.DebugMFC.manifest、msvcm90d.dll、msvcp90d.dll、msvcr90d.dll <br>Release 发布版 所依赖的库为：mfc90.dll、Microsoft.VC90.MFC.manifest、Microsoft.VC90.MFC.manifest、msvcm90.dll、msvcp90.dll、msvcr90.dll</p>
<p>三、一般是 MFC80.dll, MSVCR80.dll 等，VC6里有个 depends 工具，可以查看 DLL 的依赖。或者用 dumpbin /dependents XXXX.exe 看也行。 <br>打包可以用 installshield.</p>
<p>四、另一种方法：</p>
<p>你可以在下面这个目录里找 <br>X:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86这个文件夹下的vcredist_x86.exe 在目标机器上装这个exe 就能运行mfc开发的程序 <br>注 以你的VC目录为准</p>
<img src ="http://www.cppblog.com/jetqu2003/aggbug/59220.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/jetqu2003/" target="_blank">relaxqu</a> 2008-08-18 14:42 <a href="http://www.cppblog.com/jetqu2003/articles/59220.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>