Can a C++ Static Library link to shared library?

后端 未结 3 1262
情深已故
情深已故 2021-02-12 14:44

Say I have a static C++ lib, static.lib and I want to call some functions from a C++ shared lib, say shared.lib. Is it possible?

Now assume that I have another shared li

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-12 15:34

    The linker will not automatically bring in the other libraries, but you can use #pragma comment (lib, "static.lib") to simplify the process of linking the additional files by adding the pragma to your header files.

提交回复
热议问题