Hi there,

I'm currently trying to write a static import lib (using MASM32), which itself imports code from some external static libs.
Also I'm pretty sure all these references to external libs have been properly prototyped and there are no calling convention inconsistencies.
At least neither the compiler nor the LIB tool give any warnings or errors.
Now obviously MASM32's LIB tool doesn't embed the actual code, but only references to the external libs, so all projects using the newly build lib need
the imported static libs during link-time as well. Is there any switch to change this behaviour, i.e. embed the actual external code into the newly build lib?

My current workaround involves building a complete DLL and running it through DLL2LIB, but that's of course not a satisfactory solution...:/

Thanks for any hints,
Posted on 2005-09-09 14:17:22 by bisi
distributing the additional static library/libraries ought to be satisfactory?
Posted on 2005-09-09 15:09:28 by f0dder
Hi f0dder,

nope,  my only goal is to avoid having to distribute any additional static libs with the newly built one.
(Actually, I don't wanna 'distribute' the new lib anyway...)
Posted on 2005-09-09 16:45:51 by bisi
The GNU linker can probably do it, at least when working with ELF objects. Theoretically it should be doable with incremental linkers, but the MS and intel ones seem to be geared at exes, not libs.
Posted on 2005-09-09 17:34:31 by f0dder

There is no simple solution to what you are doing as the code in the libraries you require must be available to the libraries you are writing otherwise you will get an unresolved external error. As long as you are allows to use the other lib, use whatever linker / lib manager you like to extract any of the dependent modules in the library and add it into your own. This is just a tidier way of doing what you are already doing with DLL2LIB.
Posted on 2005-09-09 18:31:34 by hutch--
Btw, something that might work: use a library manager to "explode" the second library (I think pelle's C linker has an option for this), then add all the .obj files to your main .lib. Just remember that this could be a breach of copyright etc etc etc.
Posted on 2005-09-09 19:13:44 by f0dder
Hey, I knew there would be some easy way to achieve this, just needed someone explain my compiler suite to me...;)
Thank you both very much!
And POLIB /EXPLODE is a handy thing to use, indeed...

P.S. I'm quite concerned about copyrights (you wouldn't guess my actual profession ;)), but in this case all the import libs are self-written ones (with sources gone, you guessed it ;/).

P.P.S. Great board!  :D
Posted on 2005-09-09 20:22:26 by bisi