I am a beginner at the windows programming ( MASM32 Version 6.14). It recently occured to me - why on the earth the directory \masm32\lib exist. A final *.exe file produced by the linker refers to windows *.dll files but not to *.lib files.
You can use the object code contained in those LIBs in your application. If your app doesn't use any code from a LIB the linker doesn't need to link them. Xtreme
Sorry! What difference in this case between the /masm32/lib/user32.lib the and /windows/system/user32.dll. If my programm call subroutine KillTimer (for example) then the linker make reference to the second file (to my mind). For what purposes the object code of this procedure contains the first file.
lekimus, Libraries perform 2 functions in MASM, they can be either IMPORT libraries which means they have the data required by the linker to call specific API calls or they can be what is normally called STATIC libraries which you can write yourself. If you have a common piece of code that you use regularly and don't need to change, you can write it as a module and build a library with it and other modules. This is a very efficient way of storing large amounts of pre-compiled code. The difference between a Dynamic Link Library and a static library is that the static library code is linked into your program where a dynamic link library is called at runtime and is a a seperate file. Both have their advantages but they are different things, if you want freestanding EXE files, you will either write all of the code or use library functions to do part of it. Regards, email@example.com
Questions about those libs raise in almost every beginnerís head. Congratulations - at least you have it (a head). We dealing here with a special kind of libs - import libs. Their purpose is to put reference and some space for data (specially structured for future usage after loading module) in infamous "PE import table". This reference include name of DLL and functions from those DLL which should be linked to the module at runtime, so that module could call those functions from DLL. I could recommend excellent tutorial by Iczelion "PE-tuts". Iczelion has a talent put complicated subjects in clear and precise language so that the subjects could be understood by anybody :) For now I want just to say that the "PE" topic is very important for Win32Asm coding and is one of BASIS topics. You are not going to go far without complete understanding of it.
The linker uses the information in the .LIB file, to put the DLL file references (to API) into the .EXE file.
Thanks for all , who took part in this discussion. Michail from Russia.