0

I developed WindowsForm application using C# with Visual Studio 2010, and I have external DLL (written using VC++). When I deployed it to Windows 7, everything works fine. However, on Windows 8.1, it installed fine and run fine, until the program needed to access the library function inside the DLL. It complained that it couldn't find the DLL (even though the file is in the same location as the executable).

This happened in Windows 8.1 only (perhaps with Windows 8 as well).

Did I link the DLL incorrectly perhaps?

Cœur
  • 37,241
  • 25
  • 195
  • 267
serenity
  • 11
  • 5
  • 1
    Most likely cause: the Visual Studio 2010 Microsoft C runtime isn't installed on the Windows 8.1 machine. Or perhaps the C++ class library. Nothing to do with the OS version, except perhaps indirectly. You can diagnose this sort of problem using Process Monitor, look for file not found errors. – Harry Johnston Sep 21 '17 at 03:14
  • Thank you so much! I will give it a try tomorrow. – serenity Sep 21 '17 at 04:57
  • Thank you so much. I found (from ProcessMonitor) that the DLL actually is a debug build as it tried to access debug version of C runtime dll. Now it's all fixed. Thanks a bunch! – serenity Sep 22 '17 at 00:18
  • Possible duplicate of [How to check for DLL dependency?](https://stackoverflow.com/questions/7378959/how-to-check-for-dll-dependency) – Harry Johnston Sep 22 '17 at 00:23

2 Answers2

1

Assuming that your DLL is a windows native DLL, one of two things is happening:

  1. Windows is failing to locate the DLL
  2. The DLL has other dependencies that are not available on the machine

To check, try changing the PATH environment variable to include the folder that your DLL is in. If the program runs then it's a problem with locating the DLL.

If that doesn't work then you'll need to do some more in-depth investigation to find out what is actually happening.

There's a guide here that shows you how to determine what is happening with your program using Process Monitor to find out what is actually failing to load. This might not be your C++ DLL, it could be one of the many dependencies for it.

Corey
  • 15,524
  • 2
  • 35
  • 68
0

The answer is the comment from Harry Johnston above:

Most likely cause: the Visual Studio 2010 Microsoft C runtime isn't installed on the Windows 8.1 machine. Or perhaps the C++ class library. Nothing to do with the OS version, except perhaps indirectly. You can diagnose this sort of problem using Process Monitor, look for file not found errors.

serenity
  • 11
  • 5