Reputation: 1508
I have come across quite a few similar questions, however I didn't really get my answer.
So, I have an App.exe that depends on Static.lib, which in turn depends on a dynamic library Dynamic.dll. In Static.lib I link to Dynamic.lib import library. I do understand that now the App.exe has to have Dynamic.dll in it's directory in order to run successfully, however when I try to link the code I get an error that the App project can't find Dynamic.lib import library.
My question is, why does the App project have to link to Dynamic.lib import library when it is already linked in Static.lib?
Upvotes: 3
Views: 4227
Reputation: 6008
My question is, why does the App project have to link to Dynamic.lib import library when it is already linked in Static.lib?
At first, you need to generate your static library, so you compile with the shared library's header files and you link with the shared library.
Then to generate an .exe you compile with the static library's header files; Then you need to link with the shared library because some of the methods found in the static library are implemented in the shared library.
Upvotes: 2