Static library links in wxWidgets statically, but apps using my lib still require wxwidgets

◇◆丶佛笑我妖孽 提交于 2019-12-12 17:12:20

问题


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


回答1:


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.




回答2:


I hate to suggest the obvious, but is wxbase28.lib listed in the list of dependencies of your test application?



来源:https://stackoverflow.com/questions/1916782/static-library-links-in-wxwidgets-statically-but-apps-using-my-lib-still-requir

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!