ZBAR and QT
-
Hi,
i´m working on windows with QT 5.2 and MinGW. I tried to integrate the ZBAR libs into my Project by copying the files (zbar.h und the zbar folder with the other headers) into my Project folder and adding in my .pro file
@
HEADERS += zbar.h
INCLUDEPATH += /zbar/
@but i get these errors
@
In function 'ZN4zbar12ImageScannerC1EPNS_20zbar_image_scanner_sE':
undefined reference to `zbar_image_scanner_create´
@main.cpp
@
#include "mainwindow.h"
#include <QApplication>
#include <zbar.h>
#include <QImage>using namespace zbar;
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();//This is part of ZBar, just added it for testing ImageScanner scanner; return a.exec();
}
@hope somebody can help
thanks
-
Ok, i changed my .pro file in
@
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = zbar_gui_app
TEMPLATE = appSOURCES += main.cpp
SOURCES += mainwindow.cpp
HEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += -L$$PWD/lib/ -llibzbar-0.libINCLUDEPATH += $$PWD/include
DEPENDPATH += $$PWD/include
@and added a folder "lib" which contains
libzbar-0.lib, libzbar-0.def and libzbar.dll.a
furthermore i moved the headers in the folder "include".
But now i get a Prompt saying "During startup programm exited with code 0x0000135"
-
I don't think so. If you want, you can try it yourself.
Link to ZBAR http://zbar.sourceforge.net/
Thanks for your help.
-
It's very straightforward:
LIBS += -llibzbar-0
The author said he compiled the library with MinGW. Because of that zbar will depend on libgcc_s_dw2-1.dll, MinGW's runtime library. I'd say that the error he reported was caused by him missing this dll in his search path.