Computer programs are becoming smarter and more like people. Not surprisingly, at some point, they also needed libraries. Then the first DLL appeared . Dynamic Link Library - a dynamic link library.
What is stored in a DLL?
A program is a way of processing information. Moreover, one often has to perform the same actions. Such actions in programming are called procedures and functions. Suppose a program needs to multiply one number by another 100 times. She will refer to the corresponding function inside her until she has completed all the actions.
But there are many programs that require a multiplication operation. And before the advent of the DLL, each of them contained the same function. Physically, it represents several lines in the program. Each character is one byte. It is loaded into the computer's memory. And the memory is not infinite.
Programmers quickly realized that all such functions could be put into one program. And whoever needs it, let them turn to her. So there was a DLL. This is a library where common functions are stored instead of books.
What are dll files?
A computer knows only one way to store information. He writes it in the form of files. DLL did not escape the common fate. It is stored as window.dll files.
This means that on Windows, library files consist of a name and an extension, separated by a period. For example: msvcp120.dll. The file name can be anything, and the extension is always dll.
They are stored in the Windows system folder, "system32". Therefore, any program "knows" where to go to get the desired function. If the library is needed only by one executable file, it may be located in another place.
How it works?
An executable file includes a so-called import table. It contains information about what libraries and functions are needed to work.
When the program starts, the system reads this information from the import table. Then it loads the necessary dlls into memory. The necessary functions are copied to the address space of the executable file. After that, the library is unloaded from memory and frees it up for other tasks.
This information is already sufficient to understand what DLL files are. In reality, everything is much more complicated.
Dynamically connected hell
Everything would be fine if it were not for the pursuit of excellence. Programs are getting shorter, memory is being used better, speed is growing before our eyes. But I want even shorter, better, faster.
Therefore, new versions of old libraries appear. This is where the term “DLL hell”, “Dll hell” in our opinion, arises. It’s quite an official term. It is impossible to predict when the underworld will open its gates.
Most often, this happens like this: only yesterday everything worked like a clock, and today one, then another program throws a message that a certain library is not good, you need to reinstall it. If you know what is the DLL file that the message refers to, you can search for it and ... It will be found. Where it should be.
Here is the time to remember that some software was recently downloaded. It is installed normally and works flawlessly. Most often, the reason for incomprehensible failures lies precisely in this. The explanation is simple: the program installed a new version of the dll. It is incompatible with the old.
There is a way out - this is "inside entrance"
You can take and install the old version. Then yesterday’s installation will stop working. How to donate? Nothing.
You can use both versions. One to put in "Windows \ system32 \", the other along with the program. When the system starts looking for a file, it first looks for it in the folder with the executable file. Will not find, will search in the system. The main thing is not to confuse what should lie. This method is called "redirection".
Is there a way out of hell? Yes. But there were minor troubles. There are other dll file errors. He may simply be absent. Who is to blame - the second question. First: what to do?
Find and install
What is the msvcp120 dll file, not everyone knows. But who is "lucky" will see:
Knowing what a DLL file is, it will realize that it is a library. Where it lies is known. Why is this file selected for example? Because it occurs more often than others. This is an important system file that many programs use. There are 2 ways to fix the error:
- reinstall the program that needs this file;
- Install the library manually.
When reinstalling the program, it will download and install the dll itself.
Manual installation involves several steps:
- download a file from the Internet;
- put it in the desired folder;
- register a library;
- to restart a computer.
You must do the same with any other dll file.
Tasty on the third
The terrible nightmare of DLL hell motivated Microsoft programmers to create the NET Framework. They believe that Dll hell was the last circle of man-made hell and the new platform will lead straight to heaven. Also man-made.