我有一个项目要解压缩文件。我发现 Quazip 接近我想要的实现(检查),但是....
编译器在构建项目时说
Makefile.Release:241:警告:覆盖目标版本的命令/moc_quazipfile.o' release\moc_quazipfile.cpp:40:警告:'static void QuaZipFile::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) '在没有 dllimport 属性的情况下重新声明:以前的 dllimport 忽略了 release\moc_quazipfile.cpp:48:警告:在被 dll 链接 release\moc_quazipfile.cpp:52 引用后,警告:'QuaZipFile::staticMetaObjectExtraData'在没有 dllimport 属性的情况下重新声明:52:警告: 'QuaZipFile::staticMetaObject ' 在被 dll 链接 release\moc_quazipfile.cpp:61引用后重新声明,没有 dllimport 属性:警告:'virtual const QMetaObject* QuaZipFile::metaObject() const'在没有 dllimport 的情况下重新声明
release/moc_quazipfile.o' Makefile.Release:219: warning: ignoring
old commands for target
属性:以前的 dllimport 忽略了 release\moc_quazipfile.cpp:66:警告:'virtual void* QuaZipFile::qt_metacast(const char*)'
重新声明,没有 dllimport 属性:以前的 dllimport 忽略
了 release\moc_quazipfile.cpp:74:警告:'virtual int
QuaZipFile::qt_metacall(QMetaObject::Call, int, void* )' 在没有 dllimport 属性的情况下重新声明:以前的 dllimport 忽略
了 mingw32-make.exe[1]: 离开目录`*
* *quazip_test-build-desktop-Qt_4_8_0_for_Desktop_- MinGW _Qt_SDK__Release' release\moc_quazipfile.cpp:48:错误:
dllimport'd 类 mingw32-make.exe[1] 的静态数据成员 'QuaZipFile::staticMetaObjectExtraData' 的定义:* [release/moc_quazipfile.o] Error 1
mingw32-make.exe: * [release] Error 2 13:29:01: 进程
“C:\QtSDK\mingw\bin\mingw32-make.exe”退出,代码为2。构建项目 quazip_test 时出错(目标:桌面)执行构建
步骤“Make”时
.pro:
QT += core gui
TARGET = quazip_test
TEMPLATE = app
INCLUDEPATH += C:/QtSDK/QtSources/4.8.0/src/3rdparty/zlib
SOURCES += main.cpp\
mainwindow.cpp \
quazip/quazipnewinfo.cpp \
quazip/quazipfile.cpp \
quazip/quazip.cpp \
quazip/quacrc32.cpp \
quazip/qioapi.cpp \
quazip/moc_quazipfile.cpp \
quazip/JlCompress.cpp \
quazip/quaadler32.cpp
HEADERS += mainwindow.h \
quazip/crypt.h \
quazip/unzip.h \
quazip/quaadler32.h \
quazip/quazipnewinfo.h \
quazip/quazipfileinfo.h \
quazip/quazipfile.h \
quazip/quazip_global.h \
quazip/quazip.h \
quazip/quacrc32.h \
quazip/quachecksum32.h \
quazip/JlCompress.h \
quazip/ioapi.h \
quazip/zip.h
FORMS += mainwindow.ui
主窗口.h:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include "quazip/quazip.h"
#include "quazip/quazipfile.h"
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow *ui;
};
#endif // MAINWINDOW_H
主窗口.cpp:
#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QuaZip *temp = new QuaZip();
}
MainWindow::~MainWindow()
{
delete ui;
}
我究竟做错了什么??
BR