is LIB optimization dependent?

is LIB optimization dependent?

rahzan's picture

does the LIB file of a dll change as the result of optimization being off or on?

Does it matter if a client (of that DLL) does not have matching level of optimization to that of the DLL?

I'd be inetersted in ANY type od differences, but I am mostly concerned about loss of accuracy and secondly speed.

Thanks,
Tim

4 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.
Jugoslav Dujic's picture

Don't get confused by .lib files created by compiler when generating DLLs. These libs are just "stubs", i.e. they don't contain any "smart" code -- they contain references of dllexported functions to satisfy linker at link-time and some info about where the routine is to be found in the dll. I think that these libs doesn't change for a single byte (except maybe time tag) for debug version and release versions of various optimization levels (I'm not positive but try it yourself). For example, note that the same system stub libs in DFLib directory work fine under NT, 2000 and 9x although coresponding system dlls are entirely different.

Note that there's a technique called "run-time" or "dynamic binding" which doesn't require having .lib file at all (VB and Delphi utilize it transparently, for example).

Jugoslav

Jugoslav www.xeffort.com
rahzan's picture

Thanks Jugos,
I reasoned as much myself but then FC revealed a number of (indecipherable) differences between the two compilations. I did not pursue this so IU don;t have conclusive evidence of the difference being even due to debug setting or anything else like the time of day.

However, I have tried running a debug program with a release version of thr LIB and it did not object. Still the difference btween files was there.

Tim

Steve Lionel (Intel)'s picture

Jugoslav is correct - a DLL import library is just a way that the linker finds out about symbols exported from a DLL, it contains no code (other than a jump sometimes.)

Steve

Steve

Login to leave a comment.