using QuaZip on Windows with VS2008

1k Views Asked by At

I'm using QT4.7.3, VS2008 and trying to add QuaZip library.

I got QuaZip, Zlib and compile it, and then I can make "quazip.lib" file.

I added quazip.lib to "Project property->Configuration Properties->Linker->Input->Additional Dependencies" and include pathes.

I wrote the source code as below.

#include "Updater.h"
#include "quazip.h"

Updater::Updater(QWidget *parent, Qt::WFlags flags)
    : QMainWindow(parent, flags)
{
    ui.setupUi(this);

    QuaZip *qZip = new QuaZip();
}

but, here, I stuck in problem.

Error message is shown as below.

Updater.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: _thiscall QuaZip::QuaZip(void)" (_imp_??0QuaZip@@QAE@XZ) referenced in function "public: __thiscall Updater::Updater(class QWidget *,class QFlags)" (??0Updater@@QAE@PAVQWidget@@V?$QFlags@W4WindowType@Qt@@@@@Z) 1>.\updater.exe : fatal error LNK1120: 1 unresolved externals

I know this error occurs when declaration exists but definition doesn't exists.

As a result of find QuaZip constructor, I found as below.

QuaZip::QuaZip():
  p(new QuaZipPrivate(this))
{
}

How can I make it correct?

Thank you for any comment.

1

There are 1 best solutions below

0
On

I have found the following message in Quazip's README file:

If you want to include QuaZIP sources directly into your project or if you want to use QuaZIP compiled as a static library using "qmake CONFIG+=statliclib", you have to define the QUAZIP_STATIC macro, otherwise you're likely to run into problems as QuaZIP symbols will be marked as dllimported.

Maybe that will help you.