as far as i understood it now, you can save a lot of time and work by putting all of your most used procs and functions into libs, right? then you just link the lib to your source.. (by using includelib mylib.lib??). is that all correct?

so my next question is: how to create such a lib in detail?

what about adding new procs to the lib?

how exactly looks a lib like? i mean, is that some compiled source or something?


Posted on 2002-07-20 07:31:00 by NOP-erator
You can check wotsit.org for file formats and Iczelion?s .lib tutorial on the site you allready know :)

Posted on 2002-07-20 08:35:57 by latigo
thank you, i didn't even know that there exists such a tutorial.. :alright:

Posted on 2002-07-20 09:01:35 by NOP-erator
Hmmmmmm......... i just read the tutorial, a lib does NOT contain the functions, procedures, etc.. they're all in a DLL. But let's say i don't want to use a dll but a kind of "unit" (TP-like) that i can include.. oh.. :stupid:

hehe, why just don't write an include file :tongue: .... hehehehehehehe..

bye :grin:
Posted on 2002-07-20 09:07:06 by NOP-erator
There's static libraries and there's import libraries for DLLs.
Look at the m32lib in masm32 to see how a static library
is built, it's not exactly rocket science.
Posted on 2002-07-20 09:36:00 by f0dder
OK, that's exactly what I wanted! thanks.. and sorry that i didn't have the idea myself.. me stupid thing.. :tongue:

Posted on 2002-07-20 10:46:36 by NOP-erator
but when u create static lib, and later link it with exe (that u make)
arent u going to include all functions that are in that static lib, not just the used ones, and thus u will make executable bigger than it should normaly be?
or that is not the case, linker will include in final exe only functions that u use in file?

i think that it will be the first one but not sure...
Posted on 2002-07-20 16:48:12 by Mikky
no, AFAIK only the used functions are included in the final exe..imagine including the masm32.lib and therefore including ALL the functions in there..*puh*.. the exe wouldn't be that small..

Posted on 2002-07-20 16:53:18 by NOP-erator
Actually, either may happen, you get just the part you wanted, or you get it all. Or something in between.

The parts pulled in by the linker are basically defined by each .asm file defined the compiles to an object. The linker pulls in these objects.

Now you could write a lib as a single .asm. In that case, the linker would be forced to pull the whole thing in if any part is referenced.

So keep the pieces small as the structure of many files comprising the MSM32 lib implies.
Posted on 2002-07-20 17:35:18 by Ernie