-3

I have written my own DLL that wrap UNICODE to char and call another DLL from MicroChip. When I call my DLL from LabVIEW on my PC it works well. But if I try to call this DLL from another PC, I see the error that msvcrt.dll is missed.

To solve this problem I tried to install "Redistributing Visual C++ package for x86". It did not help. Also tried to compile library in "Release" mode with /MD tag in Runtime Library - same result.

Could you suggest me how can I solve this problem?

Artem
  • 1
  • 2
    ***I tried to install "Redistributing Visual C++ package for x86". It did not help*** Maybe you installed the wrong version. I mean the redistributable from a different version of Visual Studio. – drescherjm Feb 21 '18 at 17:02
  • 5
    There are several of these redistributables: https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads. And for each version there is the 32 and the 64 bit version – Jabberwocky Feb 21 '18 at 17:02
  • Did you install the package that corresponds to your version of VS? "for x86" are you running 32 bit code? – n. m. could be an AI Feb 21 '18 at 17:03
  • Please include the **exact** error message you received, and the specific version of VS used to compile your DLL. – Ken White Feb 21 '18 at 17:04
  • 1
    ***call another DLL from MicroChip*** Was that compiled with the same version of Visual Studio that you use? Perhaps you have a more complicated problem (mixing Visual Studio versions causing more than 1 CRT to be used at the same time). – drescherjm Feb 21 '18 at 17:06
  • 1
    I'll be honest here -- if you're going to distribute your app to other computers, you need to know every component that is required for your app to run, and not have to run into errors like this. An installation package is just one option that addresses issues like this. – PaulMcKenzie Feb 21 '18 at 17:08
  • You can use a program called dependencywalker to find your dll's dependencies if you really don't want to create an installer. see here http://www.dependencywalker.com/ – Rich Feb 21 '18 at 18:14
  • @drescherjm I tried to install the last version from microsoft.com and I found the same installer in VC\Redist\MSVC\vc_redist.x86.exe. Install it. But results is the same. – Artem Feb 23 '18 at 09:16
  • That is why I asked you what compiler version compiled the dll from Microchip. It may be important that you use the same version of Visual Studio than what they are using. That is unless the .dll has a `c` interface and isolates the memory allocation across the dll boundry. Also it should tell you what version of msvcrt.dll was missing. There should be a version number in the file name. – drescherjm Feb 23 '18 at 13:04
  • @drescherjm Thank you for your answer! I have found a solution. Something happened with VS. When I pressed "Release" mode, VS compiled in "Debug". I used another PC to compile this project and it works! Thank you for your response! So, **the solution is**: set /MD tag in Runtime Library, compile a project, use .dll from release folder. – Artem Feb 23 '18 at 17:15
  • That explains a lot. The debug runtime will not be in the redistributable because it is against the Visual Studio licence to run a debug application on a machine that does not have VS installed. – drescherjm Feb 23 '18 at 17:18

1 Answers1

0

Thanks all for replies! I have found a solution. Something happened with VS. When I pressed "Release" mode, VS compiled in "Debug". I used another PC to compile this project and it works! Thank you for your response! So, the solution is: set /MD tag in Runtime Library, compile a project, use .dll from release folder.

Artem
  • 1