简体   繁体   English

c ++和zlib静态库

[英]c++ and zlib static library

I am making a c++ (windows devc++) application which downloads a file using libcurl. 我正在制作一个使用libcurl下载文件的c ++(windows devc ++)应用程序。 I have included the libcurl source code and library to mu executable, so no external dll is required. 我已将libcurl源代码和库包含到mu可执行文件中,因此不需要外部dll。 libcurl requires zlib. libcurl需要zlib。 But I cannot find out how to include it in the executable. 但我无法找到如何将其包含在可执行文件中。 As a result zlib1.dll has to be present. 因此,必须存在zlib1.dll。 Does anybody know how to include this as well? 有人知道如何包括这个吗? Thanks in advance! 提前致谢!

You have two options. 你有两个选择。

You said you're using Dev-C++ which compiles using GCC. 你说你正在使用Dev-C ++,它使用GCC进行编译。 zlib has a static library option Makefile, just use make libz.a and it will produce the static library you desire. zlib有一个静态库选项Makefile,只需使用make libz.a ,它就会产生你想要的静态库。

Another option would be to include the zlib source code directly into your application - that means just take the zlib sources and put them inside a dedicated directory in your application's source and set DevC++ to compile it. 另一个选择是将zlib源代码直接包含到您的应用程序中 - 这意味着只需获取zlib源并将它们放在应用程序源中的专用目录中,并设置DevC ++来编译它。

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

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