Let's say I have a project I've split up into some libs and a top .asm. I make A.lib from A.asm. Then I includelib A.lib inside B.asm. I go ahead and build B.asm into B.obj. Question: If I then make changes to A.asm and rebuild to A.lib, are these changes included in B.obj? Are included libs referenced from or are they part of the object? In other words, after rebuilding A.lib, must I rebuild B.obj to get the updates in B.exe?
Posted on 2001-03-04 17:07:00 by Ernie
If i were to use B.obj in a program i was making (test.asm). I would compile test.asm into test.obj. Then i would link them from a command line: > path=%path%;D:\masm32\bin > Link /SUBSYSTEM:WINDOWS test.obj b.obj I could run Link from anywhere on the hard drive (and my system doesnt have explicitly defigned paths for masm other than defining the one above), the link will work provided the obj's are in the working dir that i called link from. This means that B.obj MUST have any (or all) A.lib routines called in B.Asm within itself, or else the link would fail from a remote area on my hard drive. I tried this by making an extra dir on a different HD. I copied 2 finished obj's (that i know uses masm32.lib) into this new folder. I opened a command window and used the above 2 command lines in the new, isolated directory. The link worked no problem, and i have yet another exe that ran fine. To answer the question: yes you will need to rebuild b.obj to include these changes (as indirectly shown above). The linker is a static linker, and doesn't dynamically control the information its processing. Even .dll's are built on static .obj's, but its up to windows to make use of them 'dynamicly'. :P (I hope i didnt put my foot in my mouth..) :P NaN This message was edited by NaN, on 3/4/2001 10:53:19 PM
Posted on 2001-03-04 22:39:00 by NaN
Nan, Well... I wouldn't say it was your WHOLE foot. ;-) I've since tried what I said I wanted to do. Basically, made changes to the code inside (but not any new or deleted exports) of a lib, and just linked this code with an object built to the old lib. Bingo, the changes appeared in the final exe. So, the compiler just sets references to the lib, and it's all the linker that then pulls in what's behind those references. Kinda cool, gonna be useful as this is turning into a HUGE project.
Posted on 2001-03-05 00:33:00 by Ernie
Really... So my error was i should have renamed my \Lib directory as well. Doh! ;) I really didnt think it would add full paths to lib's in the obj's. O well, now i know.. Nan
Posted on 2001-03-05 09:57:00 by NaN