问题:
在一个静态库A中是否可以引用一个动态库B的函数呢?
答案:
YES,但是这样一来有个问题需要注意:今后所有引用了该静态库的动态库C都必须引用动态库B,否则就会报链接错误。
但是也有一种方法可以使得静态库A的用户不需要理会这些问题,答案就是在静态库A的主头文件中加入如下一行:
#pragma comment(lib, "B.lib")
A library is just a collection of objects, which by definition have not been linked yet. The linker is not used to create the library, so it makes sense that there would be no linker options for it.
reference: