PDA

View Full Version : static & dynamic linking


mickey
16th April 2006, 16:41
Anyone can tell me any "GOOD" link where found explanation about linking? (.lib, .dll, how to link and why and when).
Thanks.

fullmetalcoder
17th April 2006, 20:49
no link but maybe a short explanation :

there are two kinds of linking :

inside an app : specific to OOP. A function can be statically or dynamically linked depending on the use of the 'virtual' keyword. This is a very important thing but I guess it's not what you're talking about

between app and lib : function, classes, ... can be dynamically or statically linked depending on the type of lib. A static lib contains everything the API offers to coder, linking an app to it just add the corresponding code to the program. Linking to a shared lib just add a bit of instructions hold in a static lib. These instructions locate the shared lib and import everything you want from it. Static linking causes a bigger size but gives better control over versions and ensures everything needed to run the app is avaiable. Dynamic linking reduces size, allow easier upgrade but may causes bugs due to absence of backward compatibility between two versions of a lib. Deciding when to use them is up to you and depend on how your app behave...

edb
21st April 2006, 10:49
a nice intro to dll usage can be found here (http://66.249.93.104/search?hl=nl&client=firefox-a&q=cache%3A7AfqZ9QJoTMJ%3Agoedel.chonbuk.ac.kr%2Fwc ham%2Ftechnote%2F%2F%2Fmain.cgi%2FMS.pdf%3Fdown_nu m%3D1087299875&btnG=Zoeken&lr=)