2

I have a .exe that is compiled with MSVC2005 using release configuration. Problem is that when I distribute this .exe to others, they are getting this message:

"This application could not be started, because the application configuration is incorrect. In order to solve the problem you should reinstall the application."

I gave them vcredist.exe and it solves the problem. But, I am wondering why this only occur on some PCs? So far, I have 1 PCs that cannot run the .exe and another that can run the .exe. Both have the same applications installed. The PC that can run my .exe has msvcr80.dll installed, and those that cannot run do not have the msvcr80.dll.

Does anyone know why msvcr80.dll is not installed in some PCs? Since both PC have the same OS and applications installed.

Are there some tool that can check which application is using which dll?

Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
chris yo
  • 1,187
  • 4
  • 13
  • 30

4 Answers4

1

If some computers already have programs, which was built with msvc 2005, installed then the copy of your exe would work. I don't think msvc redistributables are pre-installed on any versions of the OS.

If at runtime of an application you want to know if it uses a particular version of msvc runtime, you can use process explorer - a microsoft tool to show as much information about a process as possible.

nanda
  • 804
  • 4
  • 8
1

Does anyone know why msvcr80.dll is not installed in some PCs? Since both PC have the same OS and applications installed.

Windows doesn't come with any versions of the C runtime library pre-installed. The C runtime library could be installed by someone running vcredist or by installing an application that depends on it and includes a copy of it in its own installer.

Just because the two PCs you are looking at have the same applications installed doesn't mean that they have the same installation history. Perhaps one PC had installed an application that included the runtime library and then the application was uninstalled but the library was left behind.

If you're trying to distribute an application that depends on the C runtime library (or another library in the redist package), your options are:

  1. Require your users to get and install vcredist.
  2. Include a copy of the necessary library and install it in the same directory as your executable.
  3. Link to the static copy of the runtime library.
  4. Include the runtime library merge module in your .MSI installer, which will install the runtime library in a common location if it isn't already installed there.

Are there some tool that can check which application is using which dll?

Visual Studio used to come with a tool called depends.exe that examines an executable or DLL and transitively finds all the DLLs that it requires. This tool is no longer supported because it doesn't had the "Side by Side" installation feature available in newer versions of Windows. But I believe there's a free (open source?) version of depends.exe available.

If you just want to know if a particular executable has a direct dependency on a DLL, you can use dumpbin, a command line tool that's included with visual studio. If you use dumpbin /imports myapp.exe, you can see all the DLLs that it depends upon (but not necessarily the DLLs that those DLLs depend on).

Adrian McCarthy
  • 45,555
  • 16
  • 123
  • 175
0

In reply to "Are there some tool that can check which application is using which dll?" read this. Providing vcredist.exe solves the problem because they don't have Microsoft Visual C++ 2010 Redistributable Package (x86) installed/latest version in their system. One can download it from Microsoft's Official Website. Also, if you are interested in commandline, you can have a look at the command tasklist.

Community
  • 1
  • 1
Nehal J Wani
  • 16,071
  • 3
  • 64
  • 89
0

Statically linking C run time is another way of solving this problem. Here is how to do that:Static linking

Suhas
  • 63
  • 1
  • 6