gpt4 book ai didi

c++ - 如何在 Windows 10 上将 Quazip 与 Qt 5.6、Qt Creator 一起使用?

转载 作者:行者123 更新时间:2023-11-30 03:39:56 26 4
gpt4 key购买 nike

抱歉,我对这类事情没有经验,但我已经在互联网上搜索了一段时间,以了解如何在 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/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com