简体   繁体   English

链接器正在寻找链接到我自己的静态库的静态库

[英]Linker is looking for the static libraries that was linked to my own static library

I have a static library that links to a statically built Boost library.我有一个链接到静态构建的 Boost 库的静态库。 However, when my executable is linking to my own static library, it will fail with a message saying that it cannot find the Boost library.但是,当我的可执行文件链接到我自己的静态库时,它将失败并显示一条消息,指出它找不到 Boost 库。

I thought when my static library is statically linked to the Boost library, any further upstream dependency of the Boost library should be gone.我认为当我的静态库静态链接到 Boost 库时,Boost 库的任何进一步的上游依赖都应该消失。 Isn't this correct?这不正确吗?

MyLib.lib -> linked to static Boost library MyApp.exe -> links to MyLib.lib statically, Failed!, cannot find Boost library MyLib.lib -> 链接到静态 Boost 库 MyApp.exe -> 静态链接到 MyLib.lib,失败!,找不到 Boost 库

Any help is appreciated.任何帮助表示赞赏。

Static libraries are really nothing more than a collection of object files.静态库实际上只不过是目标文件的集合。 If you want to use a static library that depends on other libraries, you need to link withe other libraries as well.如果要使用依赖于其他库的静态库,则还需要链接其他库。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM