静态库链接在wxWidgets静态,但使用我的lib的应用程序仍需要wxwidgets [英] Static library links in wxWidgets statically, but apps using my lib still require wxwidgets

查看:551
本文介绍了静态库链接在wxWidgets静态,但使用我的lib的应用程序仍需要wxwidgets的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

希望有人可以帮助我在这里。
我使用Visual Studio 2005和创建一个静态库链接到wxWidgets静态。
我有:


  1. 根据他们的指南静态编译wxWidgets

  2. 添加了所有附加依赖关系属性中的所有wxWidget库

  3. >将我的链接库依赖关系属性设置为是

  4. 将C ++优化设置为已停用。

我知道这些步骤中的一些步骤不应该做,我这样做是为了情况下理性。



虽然我的库编译没有一个搭便车,包括我的静态库的测试应用程序在链接期间抱怨它不能找到'wxbase28.lib'(我包括)。



我应该注意, wxWidgets完全,所以图书馆的公共API没有提到任何wxWidget相关。测试应用程序不应该知道wxWidgets存在。



我的小图书馆已经增长到超过51 MB,所以我得到的感觉,库正在链接。 。所以为什么我的测试应用程序抱怨它找不到wxWidgets库?



谢谢

解决方案

这是构建过程中的链接步骤,它提取了依赖库:当你构建一个静态库时,它不会拉入任何递归依赖,因为没有链接步骤。



所以这两个 - 你的和wx的 - 静态库需要存在,然后为最终应用程序链接。


Hopefully someone can help me out here. I'm using Visual Studio 2005 and creating a static library that links in wxWidgets statically. I have:

  1. compiled wxWidgets statically according to their guide
  2. included the lib directory in my "Additional Library Directories" property
  3. added all of the wxWidget libs in my "Additional Dependencies" property
  4. set my "Link Library Dependencies" property to "Yes"
  5. set C++ Optimization to Disabled.

I know that some of those steps shouldn't have to be done, I did so on a "just in case" rational.

While my library compiles without a hitch, the test application that includes my static lib complains during linking that it cannot find 'wxbase28.lib' (which I included).

I should note that I abstracted wxWidgets out completely, so the library's public API has no mention of anything wxWidget-related. The test app shouldn't know that wxWidgets exists.

My tiny library has grown to over 51 MB, so I get the feeling that the libraries are being linked in... so why does my test application complain that it cannot find the wxWidgets library?

Thank you

解决方案

It is the link step in the build process that pulls dependent libs in : When you build a static library, it does NOT pull in any recursive dependencies as there is no link step.

So both - your - and wx's - static libs need to be present then for the final application to link.

这篇关于静态库链接在wxWidgets静态,但使用我的lib的应用程序仍需要wxwidgets的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆