Visual C++/Studio: Application configuration incorrect?

后端 未结 10 1514
执笔经年
执笔经年 2020-12-18 11:11

My C(++) program, written and compiled using Visual C(++)/Visual Studio, runs fine on my own machine, but refuses to run on another machine. The error message I get is \"Thi

10条回答
  •  醉梦人生
    2020-12-18 11:57

    It is much the simplest to link to the runtime statically.

    c++ -> Code Generation -> Runtime Library and select "multi-threaded /MT"

    However, this does make your executable a couple hundred KByte larger. This might be a problem if you are installing a large number of small programs, since each will be burdened by its very own copy of the runtime. The answer is to create an installer.

    New project -> "setup and deployment" -> "setup project"

    Load the output from your application projects ( defined using the DLL version of the runtime ) into the installer project and build it. The dependency on the runtime DLL will be noticed, included in the installer package, and neatly and unobtrusively installed in the correct place on the target machine.

提交回复
热议问题