作者热门文章
- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
抱歉,我对这类事情没有经验,但我已经在互联网上搜索了一段时间,以了解如何在 Win 10 上将 Quazip 与 Qt 5.6 一起使用。我将不胜感激关于如何使用的步骤列表构建 Quazip 并在 Qt Creator 中使用它。
到目前为止,我尝试下载 Quazip,并将 pri 文件包含在我的 .pro 文件中
include(quazip-0.7.2/quazip.pri)
然后我替换了以下的每个实例:
#include "zlib.h"
和
#include <zlib.h>
到
#include <QtZlib/zlib.h>
执行此操作后,我收到许多编译器警告和一些错误。
我的错误是:
QuaZIODevice::staticMetaObject': definition of dllimport static data member not allowed
QuaGzipFile::staticMetaObject': definition of dllimport static data member not allowed
QuaZipFile::staticMetaObject': definition of dllimport static data member not allowed
我的所有 15 条警告都包含:
inconsistent dll linkage
我非常感谢在这件事上的任何帮助。
最佳答案
引用自文档:
By default, QuaZIP compiles as a DLL/SO, but you have other options:
- Just copy appropriate source files to your project and use them, but you need to define QUAZIP_STATIC before including any QuaZIP headers (best done as a compiler option). This will save you from possible side effects of importing/exporting QuaZIP symbols.
这似乎是您正在做的,所以您应该将 DEFINES += QUAZIP_STATIC
添加到您的 .pro 文件中。
关于c++ - 如何在 Windows 10 上将 Quazip 与 Qt 5.6、Qt Creator 一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38463163/
我是一名优秀的程序员,十分优秀!