2016-07-19 59 views
1

對不起,我沒有這種東西的經驗,但我一直在尋找互聯網瞭解如何在Win 10上使用Qt 5.6的Quazip。我將不勝感激關於如何構建Quazip並在Qt Creator中使用它。如何在Windows 10上將Qt 5.6與Qt Creator一起使用Quazip?

到目前爲止,我嘗試下載Quazip,以及包括我的.pro文件的PRI文件

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 

我非常感謝在這個問題上的任何幫助。

回答

2

從文檔引述:

默認情況下,QuaZIP編譯爲一個DLL/SO,但你還有其他選擇:

  • 適當的源文件只需複製到您的項目,並利用它們,但在包含任何QuaZIP標頭之前(最好是作爲編譯器選項完成)之前,您需要定義QUAZIP_STATIC。這將使您免於導入/導出QuaZIP符號的可能副作用。

這似乎是你在做什麼,所以你也許應該補充DEFINES += QUAZIP_STATIC到您的.pro文件。

+0

解決了這個問題!謝謝! – Dillydill123