How to create win32 dll without msvcr90d.dll?

I am trying to recreate an existing C Win32 DLL with a simple simple function. I managed to do this using VS C ++ 2008 Express, and my new DLL works on my Vista dev machine and on the client XP machine. However, it does not work on other sites. I checked the dependencies, and my DLL requires the MSVCR90D.dll and KERNEL32.dll files, where the source DLL only needs KERNEL32.dll.

What is MSVCR90D.dll and how do I create a simple Win32 DLL without this dependency?

+2
c compiler-construction winapi
source share
5 answers

Link with a static version of the C runtime library. The parameter is located in the "Code Generation" section of the project properties. Then you donโ€™t have to worry about the MSVCR * DLL at all.

+2
source share

D at the end of MSVCR90D.dll indicates that you have compiled your .exe in debug mode. You should distribute your application only in release mode.

You can make sure that they have everything they need if they install the Microsoft Visual C ++ 2008 x86 or x64 redistributable package. Otherwise, you probably just copy the files they need by finding them on your computer (first check on% systemroot% \ system32)

See this link on MSDN .

+8
source share

"D" in the name means debugging. This is an explicit indicator of the Visual Studio Debug build. Use the Release assembly and everything will be fine.

If the target system does not yet have C runtime, you should usually use the official installer to put it there. Some of the runtime versions that you might want to learn about are the following:

You can also develop a complete installation package that includes the redistributable DLLs (but not the debugging DLLs) your application needs and correctly process assembly assemblies (SxS) in the system assembly cache using a well-known technique like merge modules. This approach is simpler if you have a full installation of Visual Studio (and not a free version of VS Express), but the resulting installation packages may still not work on the working environment on older (for example, Win 2K or 9x) platforms.

The MSDN article Redistributing Visual C ++ Files describes which rules and how to follow them as easily as possible. This provides a starting point for learning more about many deployment issues.

If the original DLL whose functionality you are replacing does not have a link to MSVCR90.DLL, then it should be statically linked to the runtime. You should probably check out the assumptions about the intended application that will call your DLL. Mixing C runtime libraries in one process is not always easy. If the hosting application is already using MSVCR90.DLL, you also need to. This is a more serious problem than is suitable for answering a specific question, but I would advise you to research it and ask new questions as necessary.

Another approach that should be avoided by installing later DLLs is to reference MSVCRT.DLL, which is distributed in modern versions of windows as a system component. It is a runtime environment shipped with Visual C 6.0, slightly updated for critical issues, and maintains current according to the OS. It is generally not available for 64-bit collections, and it is rather difficult to fool Visual Studio into using it instead of a newer runtime.

+3
source share

Check if your client machine has a 2008 run time on its system or not. If not, you can install it on your system or statically compile the runtime with your application.

0
source share

Most likely, you will want to make the Release version of your DLL, test and distribute it, and not on the Debug assembly that you are distributing now.

However, you can create a Debug DLL that is dependent on MSVCR90.DLL, not a debug version of this DLL. For this (VS 2008 SP1, the instructions are similar for other VS):

  • Go to the "Project Properties" (right-click on the project in the "Solution Explorer" panel, select "Properties" in the menu).
  • Go to Configuration Properties \ C / C ++ \ Code Generation.
  • In the Runtime Library, you probably have a โ€œMulti-threaded Debug DLLโ€. Change this to a "Multithreaded DLL".

You will have to recompile everything, but now you must contact the non-debug VS DLL.

0
source share

All Articles