How to remove dependency on mfc80.dll and msvcr80.dll?

My code does not use MFC. However, when I built my static library, the party that is trying to use it claims to be hard on them because my lib code has the following dependencies:

mfc80.dll and msvcr80.dll

Is there any way to remove them and rebuild? I am using vs2008.

+4
source share
2 answers

The static library defaults to a dynamic runtime, so your code is dependent on msvcr80.dll. Visual C ++ programs must reference the runtime. You can modify the static library to use static runtime to remove the dependency. This is done in the configuration properties | C / C ++ | Code Creation | Setting up the runtime library. However, the selected runtime library should match what is used in the project that links your static library.

Your code probably depends on mfc80.dll because you have configuration properties | General | Using MFC for one of the MFC options.

In my opinion, Visual C ++ (and Windows in general) was created for dynamic libraries and dynamic runtimes. Static libraries seem more like hacking because they have an amazing amount of restrictions, traps, and peculiar behavior. Better to become familiar with the creation and consumption of dynamic libraries - better in the long run.

+3
source

mscvr80.dll is a CRT release. You can remove this dependency by setting the compiler for a static link. Most likely, you are trying to download MFC, because the project is configured to use MFC, even if you are not using it. You can delete this in the project settings.

Although, the question arises as to why VS2008 will produce dependencies of mfc80.dll and mscvr80.dll instead of mfc90.dll and mscvr90.dll.

0
source

Source: https://habr.com/ru/post/1332623/


All Articles