Static link libraries on other computers
When I specify a .lib file to link to in my application, why does it work for my friend, who doesn't have these .lib files? Do they somehow link to the .dlls?
Also, why use static link libaries as opposed to dynamic link libraries, while we're here. :p I'll search anyway, but if anyone can be bothered answering, go ahead.
Re: Static link libraries on other computers
Quote:
Originally posted by bennyandthejets
When I specify a .lib file to link to in my application, why does it work for my friend, who doesn't have these .lib files? Do they somehow link to the .dlls?
Also, why use static link libaries as opposed to dynamic link libraries, while we're here. :p I'll search anyway, but if anyone can be bothered answering, go ahead.
You are talking about a .lib that is associated with a .DLL (an import library?)
The .lib only has the code that is needed to load the .DLL.
You don't NEED to link the .lib at all. You could manually, using LoadLibrary and other functions, work with the DLL only. However, it can be a pain in the ass to reinvent the wheel everytime you need to execute a function in a DLL, so when you build a DLL, the compiler is nice enough to auto-generate this code, and put it in a static library. Your program calls functions in the static library, and the functions in the static library handle loading the DLL and then they call the DLL versions.