zoukankan      html  css  js  c++  java
  • vs2005及以上版本的程序分发问题

        我们使用vs2005及以上版本编译的应用程序(C/C++),在客户机器运行时,会出现:

        “由于应用程序的配置不正确,应用程序未能启动,重新安装应用程序可能会纠正这个问题”

        那么,我们怎么解决这个问题呢?

        我们知道,使用VC编译C/C++程序,都需要相关的C runtime库才能运行。

        下表为VC6以上版本使用C运行库情况:

    VS版本 VC版本 C运行库
    VS98 6.0 msvcr.dll
    VS2003 7.1 msvcr71.dll
    VS2005 8.0 msvcr80.dll
    VS2008 9.0 msvcr90.dll
    VS2010 10.0 msvcr10.dll

        用VS2003以上版本的IDE编译的应用程序,怎么发布给最终用户呢?
        (1)IDE默认
            找到vcredist_x86.exe文件,随应用程序分发下去。
            这个vcredist_x86.exe需要用户独立安装。
           安装完,在“添加或删除程序”中会出现:

    VS版本 显示名称(添加或删除程序)
    VS2005 Microsoft Visual C++ 2005 Redistributable
    VS2008 Microsoft Visual C++ 2008 Redistributable - x86 xxx
    VS2010 Microsoft Visual C++ 2010 x86 Redistributable - xxx

         注意:我们分发的vcredist_x86.exe文件,一定要拷贝开发机器上的!

                     (例如,VS2005的vcredist_x86.exe文件,

                        在我机器上的位置:C:Program FilesMicrosoft Visual Studio 8SDKv2.0BootStrapperPackagesvcredist_x86vcredist_x86.exe)

         (2)VC6模式

             (英文版本的IDE)
             a. 设置使用静态MFC
                "Project" -> "Properties" -> "Configuration Properties" -> "General"
                把"Use of MFC"设置为"Use MFC in a Static Library"
             b. 设置运行库为MT
                "Project" -> "Properties" -> "Configuration Properties" -> "C/C++" -> "Code Generation"
                把"Runtime Library"设置为"Multi-threaded (/MT)"

    参考文章:http://waterlin.blog.35.cn/articles/how-to-compile-static-link-library-program-in-vc2008.html(细节之锤)

  • 相关阅读:
    bzoj1415 NOI2005聪聪和可可
    Tyvj1952 Easy
    poj2096 Collecting Bugs
    COGS 1489玩纸牌
    COGS1487 麻球繁衍
    cf 261B.Maxim and Restaurant
    cf 223B.Two Strings
    cf 609E.Minimum spanning tree for each edge
    cf 187B.AlgoRace
    cf 760B.Frodo and pillows
  • 原文地址:https://www.cnblogs.com/dyllove98/p/3148479.html
Copyright © 2011-2022 走看看