Static library contain dynamic library

S

sealo

Hello,
I have a test in VS2005 that static library A.lib use the dynamic
library C.dll.
Then a application App use the A.lib.

App-->A.lib-->C.dll

It works. But if I remove the C.dll, the app tell me can not find the
C.dll.
I think because A.lib is a static library, so it should contain the
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?
 
B

Ben Voigt [C++ MVP]

sealo said:
Hello,
I have a test in VS2005 that static library A.lib use the dynamic
library C.dll.
Then a application App use the A.lib.

App-->A.lib-->C.dll

It works. But if I remove the C.dll, the app tell me can not find the
C.dll.
I think because A.lib is a static library, so it should contain the
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?

Not unless you have source code for C.dll. A lot of information is stripped
during the linking process (where different functions begin and end, for
instance).
 
W

William DePalo [MVP VC++]

sealo said:
I have a test in VS2005 that static library A.lib use the dynamic
library C.dll.
Then a application App use the A.lib.

App-->A.lib-->C.dll

It works. But if I remove the C.dll, the app tell me can not find the
C.dll.
I think because A.lib is a static library, so it should contain the
C.dll in it during the build. But actually, it doesn't.
Is there some method to make A.lib contain C.dll, but do not need to
deliver both?

No, you can not morph a dynamic load library into a static library. Of
course if you have the source to C you can include it in A and recompile it
into the static library.

Regards,
Will
www.ivrforbeginners.com
 
S

sealo

Not unless you have source code for C.dll. A lot of information is stripped
during the linking process (where different functions begin and end, for
instance).

I have the source of C. So, the only method is to recompile the C into
static lib. Then rebuild A.lib
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top