Visual C++/Studio: Application configuration incorrect?

后端 未结 10 1517
执笔经年
执笔经年 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.

    0 讨论(0)
  • 2020-12-18 11:59

    The correct VC Redist package for you is part of your Visual Studio installation. For VC 8, you can find it here:

    \Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86
    
    0 讨论(0)
  • 2020-12-18 12:00

    POSSIBLE SOLUTION........

    EDIT: (removed most of my post) Long story short, I was having similar problems, getting the "Application Configuration Incorrect" messages, etc etc. Depends.exe was only finding ieshims.dll and wer.dll as possible issues, but this is not the problem. I ended up using the Multithreaded (/mt) compile option. What HAS worked though, as a workable solution, is making an installer with InstallShield. I've selected several merge modules in installshield builder and this seems to have fixed my problem. The modules selected were: VC++ 9.0 CRT, VC++ 9.0 DEBUG CRT, and the CRT WinSXS MSM merge module. I'm pretty sure its the WinSXS merge module that has fixed it.

    DEBUG CRT: I noticed somewhere that (no matter how hard I tried, and obviously failed thus far), my Release version still depended on the DEBUG CRT. If this is still the case, the InstallShield merge module has now placed the DEBUG CRT folder in my WinSXS folder :) Being somewhat of a novice with VC++ I assume that this would normally be used to distribute debug versions of your programs to other people. To test if this is what fixed my problem I removed the DEBUG CRT folder from the WinSXS folder and the application still worked. (Unless something is still running in the background etc etc - I'm not that into it)

    Anyway, this has got things working for me on an XP SP3 fully updated machine, and also on a VMWare XP SP3 machine with the bare bones (.net 3.5 and VC++ 2008 RTM basically) - and also on a mate's XP machine where it previously wasn't working.

    So give these things a try, you might have some luck.

    0 讨论(0)
  • 2020-12-18 12:03

    I ran into this problem and was able to fix it very simply.

    Visual studio gives you the option (on by default) to build a manifest for each build.

    The manifest was put in the release folder, but it was a different release folder than the exe.

    Even when using the setup utilities it was not packaged.

    You should look for a file names something like myprogram.exe.indermediate.manifest

    If this is in the same folder as the exe (and you have all the dlls) it should run

    0 讨论(0)
提交回复
热议问题