Search code examples
qtlibarchive

Qt - problem integrating third party library (libarchive)


I'm having an error when I integer libarchive in Qt 5.14.2. I'm on windows. This is the error:

undefined reference to `archive_read_new'

In my main.cpp file, I have:

    struct archive *a;
    a = archive_read_new();

I compile sucessfully libarchive 3.4.2 with mingw64 but I'm having trouble to integer it in Qt.

In my libarchive folder I have:

  • include (containing archive.h & archive_entry.h)
  • lib (containing libarchive.dll.a & libarchive.dll)

In my .pro file:

INCLUDEPATH += "path\libarchive\include"
DEPENDPATH += "path\libarchive\include"

LIBS += -Lpath\libarchive\lib -larchive

But still, there is some thing I'm missing.

Do you have an idea ?


Solution

  • Found it. I compile libarchive with Mingw64 so I have to compile my Qt application with the 64bit version of Mingw.