What is contained in lib?
-
What's the difference between import liberary and static program liberary, they seems to have the same suffix(.lib)? Can somebody provide me the explicit demonstration of lib file. BTW, i have learnt PE format already.
When you compile a file called, say, "A.cpp", you normally get an output file called "A.obj". Essentially a
.lib
file is a library that contains multiple.obj
files. Historically there was a separate command for creating them. If you've studied the PE file then you're already know most of what you after. See here[^].Steve
-
When you compile a file called, say, "A.cpp", you normally get an output file called "A.obj". Essentially a
.lib
file is a library that contains multiple.obj
files. Historically there was a separate command for creating them. If you've studied the PE file then you're already know most of what you after. See here[^].Steve
And an import library contains the signatures of the exported functions and the name of the DLL file that contains the actual implementation.
«_Superman_» I love work. It gives me something to do between weekends.
-
When you compile a file called, say, "A.cpp", you normally get an output file called "A.obj". Essentially a
.lib
file is a library that contains multiple.obj
files. Historically there was a separate command for creating them. If you've studied the PE file then you're already know most of what you after. See here[^].Steve
thanks! why lib is smaller than dll? if lib is the combination of all objects, and dll also a combination of all objects(some have been allocated though), dll should be equal of smaller in size than lib. And are you saying import liberay and static program liberary are exactly the same?
-
When you compile a file called, say, "A.cpp", you normally get an output file called "A.obj". Essentially a
.lib
file is a library that contains multiple.obj
files. Historically there was a separate command for creating them. If you've studied the PE file then you're already know most of what you after. See here[^].Steve
thanks! why lib is smaller than dll? if lib is the combination of all objects, and dll also a combination of all objects(some have been allocated though), dll should be greater in size than lib. And are you saying import liberay and static program liberary are exactly the same?
-
thanks! why lib is smaller than dll? if lib is the combination of all objects, and dll also a combination of all objects(some have been allocated though), dll should be equal of smaller in size than lib. And are you saying import liberay and static program liberary are exactly the same?
lib doesn't contain any "logic" inside. It's just a dummy. It contains information about the exported symbols from the dll. How will it have the same size of the dll then? But if it's a static library, yes, it will have brains and the size will be big. Unlike a dll, this static libraries get "fixed up" to the executables. But I guess you aren't concerned about the latter.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
-
lib doesn't contain any "logic" inside. It's just a dummy. It contains information about the exported symbols from the dll. How will it have the same size of the dll then? But if it's a static library, yes, it will have brains and the size will be big. Unlike a dll, this static libraries get "fixed up" to the executables. But I guess you aren't concerned about the latter.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
VuNic wrote:
lib doesn't contain any "logic" inside.
That's not necessarily true. Import libraries just contain, essentially, function names and the name of the containing DLL, so it’s true in that case. However, the “other” sort of lib file contains machine code and data.
Steve
-
thanks! why lib is smaller than dll? if lib is the combination of all objects, and dll also a combination of all objects(some have been allocated though), dll should be greater in size than lib. And are you saying import liberay and static program liberary are exactly the same?
It need not be. If it's an import library it will be quite small.
Steve
-
VuNic wrote:
lib doesn't contain any "logic" inside.
That's not necessarily true. Import libraries just contain, essentially, function names and the name of the containing DLL, so it’s true in that case. However, the “other” sort of lib file contains machine code and data.
Steve
Stephen Hewitt wrote:
That's not necessarily true. Import libraries just contain, essentially, function names and the name of the containing DLL, so it’s true in that case. However, the “other” sort of lib file contains machine code and data.
Did you really read my message till the end?
Stephen Hewitt wrote:
However, the “other” sort of lib file contains machine code and data.
But if it's a static library, yes, it will have brains and the size will be big. Unlike a dll, this static libraries get "fixed up" to the executables. But I guess you aren't concerned about the latter. I think both mean the same.
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus