Qt 和 zip 文件
我正在尝试编写一个简单的 Qt 应用程序,它将访问 zip 文件并读取这些 zip 文件的内容(内容是文本文件)。许多帖子都说 Quazip 是解决方案。
作为Qt新手并且来自.Net背景,我真的不知道如何使用Quazip,我下载了Quazip源代码,但我不确定,我应该编译它还是应该在我的项目中使用源代码。我真的不知道。
非常感谢任何帮助。 问候。
I'm trying to write a simple Qt app that will access zip files and read the content of these zip files (the content are text files). Many posts says that Quazip is the solution.
Being new to Qt and coming from .Net background, I really don't know how to use the Quazip, I downloaded the Quazip source but I'm not sure, should I compile it or should I use the source code in my project. I really have no clue.
Any help is much appreciated.
Regards.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
看来你有多种选择。您可以通过将相关文件复制到您的项目中来立即使用源代码。然而,默认情况下,运行时会编译静态库
,在这种情况下,您需要将相关路径添加到 .pro 文件,以便它找到静态库。
It seems as you have various options. You can use source code immediately by copying the relevant files into your project. By default however a static library is compiled when you run
and in that case you need to add the relevant path to your .pro file so that it finds is static library.
那么,您有多种选择:
qmake CONFIG+=staticlib
)。优点:更新更容易,因为您不必处理结构更改,只需重新编译 QuaZip 并重建/重新链接您的项目。缺点:您仍然需要重新编译和重新链接。如果您只需要读取某个随机项目中的一些 zip 文件,那么这三个中的任何一个都可以。您可能也不必更新 QuaZip,除非您发现一些需要修复的错误。
至于二进制兼容性:保证第三级版本更改(xyz1 -> xyz2)是二进制兼容的。至于次要版本更改(x.y1 -> x.y2),它们可能在一段时间内不会兼容二进制,直到 Pimpl 惯用法正确实现为止。
Well, you have several options:
qmake CONFIG+=staticlib
). Pros: updating is easier as you don't have to deal with structural changes, only recompile QuaZip and rebuild/relink your projects. Cons: you still have to recompile and relink.If you just need to read some zip files in some random project, any of these three will do fine. You probably won't have to update QuaZip either, unless you find some bugs that need to be fixed.
As for the binary compatibility: it is guaranteed that third level version changes (x.y.z1 -> x.y.z2) are binary compatible. As for minor version changes (x.y1 -> x.y2), they probably won't be binary compatible for some time, until the Pimpl idiom is implemented properly.