Anyone can tell me any "GOOD" link where found explanation about linking? (.lib, .dll, how to link and why and when).
Thanks.
Anyone can tell me any "GOOD" link where found explanation about linking? (.lib, .dll, how to link and why and when).
Thanks.
Regards
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...
Current Qt projects : QCodeEdit, RotiDeCode
a nice intro to dll usage can be found here
mickey (21st April 2006)
The link can not be opened, who can give a valid link? Thanks!
Some pros and cons have been listed in our wiki: [WIKI]Building static applications[/WIKI].
J-P Nurmi
Having static libraries work with qmake seems to require quite a bit of black magic. I've tried getting it working with the prebuilddefs, the postbuild defs, and the createprl methods of having static libraries properly recognize library dependencies during compilation. The only method that I've found that works is tweaking the order in which static libraries are compiled in order to resolve any linking errors.
I have found that the documentation online is frustratingly sparse and that a lot of the links to documentation are dead. So when trying to decide whether or not to use static or dynamic linking, keep in mind that you will have to deal with a few headaches to get everything linking properly.
Something that I haven't successfully gotten to work with static linking is the addition of the -( and -) flags that you can add straight to the ld linker. It seems like these flags are not recognized by the LDFLAGS you can place in a .pro file. Also, those flags really add to your compilation time, however when using them you don't have to deal with re-ordering of libraries.
Bookmarks