使用Visual Studio 2012的静态libzip [英] static libzip with Visual Studio 2012

查看:156
本文介绍了使用Visual Studio 2012的静态libzip的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用libzip库构建一个小应用程序。我在本文的帮助下下载并编译了libzip:



http://stackoverflow.com/questions/10507893/libzip-with-visual-studio-2010



问题在于它动态编译库,需要zlib.dll和zip.dll存在。我想完全静态地编译应用程序,因此不需要额外的dll。有人知道我该怎么做吗?



谢谢!

I am trying to build a little application using libzip library. I downloaded and compiled libzip with assistance of this article:

http://stackoverflow.com/questions/10507893/libzip-with-visual-studio-2010

The problem is that it compiles libs dynamically, requiring both zlib.dll and zip.dll to be present. I want to compile the application completely statically, so no additional dlls will be required. does someone know how I can do that?

Thanks!

推荐答案

你只能这样做你有最终exe中想要的所有内容的完整源代码。

如果你有,那么简单的答案是将所有源代码放在一个项目中,然后构建一个exe。

您当然可以将zlib和zip部件构建为静态库,然后将它们链接到您的exe中。

它从您链接的项目看起来就好像你是使用CMake来做到这一点。如果是这样的话,你真的需要把CMake放在问题的标题中,或者至少要明确说明你想要的帮助CMake是非常专业的。



否则你要这样做,你需要创建一个或多个某种形式的新项目,Make文件或IDE来完成工作。首先为一个基本上空的可执行文件或''Hello World''应用程序做一个,一旦有效,或者尝试将zlib作为静态库。

如果卡住,请发布详细信息。
You can only do that if you have the complete source code for everything you want in your final exe.
If you have then the simplistic answer is to put all the source code in one project and just build the one exe.
You could of course build the zlib and zip parts as static libraries and then link these into your exe.
It looks from the item you linked as if you''re using CMake to do this. If that''s the case you really need to put CMake in the title of the question or at least make it very clear if that''s what you want help with CMake is pretty specialist.

Otherwise however you do this you''re going to need to create one or more new ''projects'' of some form, Make file or IDE to get the job done. Do one for an essentially empty executable or ''Hello World'' application first and once that works perhaps try zlib as a static library.
Post the details if you get stuck.


这篇关于使用Visual Studio 2012的静态libzip的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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