0

I'm trying to add a library to a project. https://github.com/AlexanderVatov/DuckX. Using qmake. I encountered the following errors when executing the test code proposed by the author of the library: errors

I built the library via Cmake and compiled it in Visual Studio 2019. Then I added the library as "External library" referring to https://doc.qt.io/qtcreator/creator-project-qmake-libraries.html.

.pro file looks like this:

QT -= gui
CONFIG += c++11 console
CONFIG -= app_bundle
SOURCES +=
main.cpp
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

win32:CONFIG(release, debug|release): LIBS += -L$$PWD/duckx/lib/ -lduckx
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/duckx/lib/ -lduckxd
else:unix: LIBS += -L$$PWD/duckx/lib/ -lduckx

INCLUDEPATH += $$PWD/duckx/include/duckx
DEPENDPATH += $$PWD/duckx/include/duckx

HEADERS +=
duckx/include/duckx/constants.hpp
duckx/include/duckx/duckx.hpp
duckx/include/duckx/duckxiterator.hpp
duckx/include/duckx/pugiconfig.hpp
duckx/include/duckx/pugixml.hpp
duckx/include/duckx/zip.h`

To solve the problem, I tried to rebuild the project and use different compilers

Toribori
  • 1
  • 2
  • are you building your QT app and the library with the same compiler? Have you checked the compiler command line QT is using? – Alan Birtles Mar 12 '22 at 12:54
  • The problem was in the compiler. To compile the library, I used the Microsoft compiler and to compile the MinGW project. Changed MinGW to Microsoft compiler and everything worked. – Toribori Mar 12 '22 at 14:38

0 Answers0