This is a bit oversimplified but should cover it.
When people write computer programs, they use “libraries” that give names to pieces of code that do things.
So let’s say someone used some code on Windows named “DrawRectangle”. Obviously that code would do something to draw a rectangle on the screen. The code that actually does that is part of Windows and located in special files called “libraries”. When the person writes their program, a tool called a “compiler” makes sure everything looks good and when it sees the “DrawRectangle” part, it generates some instructions that tell Windows what library should have the file and the name of the code to run.
So if you try to run the program on Linux, it might start running, but as soon as it gets to “DrawRectangle”, things go wrong. Linux doesn’t have that Windows library, and even if it did the way to draw a rectangle on Linux is probably different so the Windows code wouldn’t work anyway.
Wine and tools like it takes advantage of that the program is really only saying “please run the code named DrawRectangle in this library”. They wrote their own library with a DrawRectangle method that does the right thing on Linux. When you run a program with Wine, it sets things up so when Linux sees “Call DrawRectangle in this Windows library”, instead it will do “Call DrawRectangle in this Wine library”. Since the Wine library is made to work on Linux, it works.
That was a lot of work, though. There are hundreds of Windows libraries with thousands of bits of code that had to be implemented. Not all of them are documented, so sometimes the Wine people had to guess what they are supposed to do.
Put more simply:
Used to we had phone books. So if you wanted to call Pizza Hut in Tallahassee, FL, you looked in the Tallahassee phone book for the Pizza Hut location with the address you want.
Later, if you wanted to call Pizza Hut in Houston, TX, you looked for “Pizza Hut” in the Houston phone book for a location with the address you want.
Windows is like the Tallahassee phone book. It’s got a Pizza Hut’s number. Wine is like the Houston phone book. It ALSO has a phone number for a Pizza Hut. It’s just a different number because you’re in a different city.
The program’s just saying, “I need to call Pizza Hut” and doesn’t care what phone book it gets. When it gets a phone book, it looks for “Pizza Hut” and calls the first number it sees.
Latest Answers