zdenop / qt-box-editor

QT4 editor of tesseract-ocr box files
https://zdenop.github.io/qt-box-editor/
Apache License 2.0
170 stars 66 forks source link

Error during make involving leptonica and libtiff #77

Closed NolanBrb closed 5 years ago

NolanBrb commented 5 years ago

Hi ! I'm trying to install qt-box editor. I have installed all the dependencies (QT5 is installed with anaconda, I've installed leptonica from source, version 1.78.0 downloaded on http://www.leptonica.org/ and tesseract 4.00).

I've placed qt-box-editor-master in my ~ directory, and when I run qmake I get this message :

Info: creating stash file /home/julien/qt-box-editor-master/.qmake.stash Project MESSAGE: Qt 5.9.7 was detected. Which seems fine, but when I run the make command I get this :

(base) julien@julien-HP-Pavilion-Laptop-15-cs0xxx:~/qt-box-editor-master$ make /home/julien/anaconda3/bin/uic dialogs/ShortCutDialog.ui -o build/release/ui_ShortCutDialog.h /home/julien/anaconda3/bin/uic dialogs/GetRowIDDialog.ui -o build/release/ui_GetRowIDDialog.h /home/julien/anaconda3/bin/uic dialogs/SettingsDialog.ui -o build/release/ui_SettingsDialog.h /home/julien/anaconda3/bin/uic dialogs/FindDialog.ui -o build/release/ui_FindDialog.h /home/julien/anaconda3/bin/uic dialogs/DrawRectangle.ui -o build/release/ui_DrawRectangle.h g++ -c -pipe -std=c++11 -O2 -std=gnu++11 -w -D_REENTRANT -fPIC -DAPP_VERSION=\"1.12rc1\" -DQT_NO_DEBUG -DQT_SVG_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -I. -I. -Idialogs -Isrc/include -Isrc -I/opt/include/ -I../anaconda3/include/qt -I../anaconda3/include/qt/QtSvg -I../anaconda3/include/qt/QtWidgets -I../anaconda3/include/qt/QtGui -I../anaconda3/include/qt/QtNetwork -I../anaconda3/include/qt/QtCore -Ibuild/release -Ibuild/release -I../anaconda3/mkspecs/linux-g++ -o build/release/main.o src/main.cpp [...] g++ -Wl,-O1 -Wl,-rpath,/home/julien/anaconda3/lib -o release/qt-box-editor-1.12rc1 build/release/main.o build/release/MainWindow.o build/release/ChildWidget.o build/release/DelegateEditors.o build/release/TessTools.o build/release/SettingsDialog.o build/release/GetRowIDDialog.o build/release/ShortCutsDialog.o build/release/FindDialog.o build/release/DrawRectangle.o build/release/qrc_application.o build/release/qrc_QBE-GNOME.o build/release/qrc_QBE-Faenza.o build/release/qrc_QBE-Oxygen.o build/release/qrc_QBE-Tango.o build/release/moc_MainWindow.o build/release/moc_ChildWidget.o build/release/moc_DelegateEditors.o build/release/moc_SettingsDialog.o build/release/moc_GetRowIDDialog.o build/release/moc_ShortCutsDialog.o build/release/moc_FindDialog.o build/release/moc_DrawRectangle.o -L/opt/lib -ltesseract -llept -L/home/julien/anaconda3/lib -lQt5Svg -lQt5Widgets -lQt5Gui -lQt5Network -lQt5Core -lGL -lpthread //usr/local/lib/liblept.so : référence indéfinie vers « TIFFGetVersion@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFReadDirectory@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFReadRGBAImageOriented@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFWriteScanline@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFGetField@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFScanlineSize@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFClose@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFClientOpen@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFGetFieldDefaulted@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFCleanup@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFOpen@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFSetSubDirectory@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFSetField@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFCurrentDirOffset@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFPrintDirectory@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFSetWarningHandler@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFSetErrorHandler@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFSetDirectory@LIBTIFF_4.0 » //usr/local/lib/liblept.so : référence indéfinie vers « TIFFReadScanline@LIBTIFF_4.0 » collect2: error: ld returned 1 exit status Makefile:302: recipe for target 'release/qt-box-editor-1.12rc1' failed make: *** [release/qt-box-editor-1.12rc1] Error 1

The error seems linked with my version of LibTiff, which is the one which comes with anaconda (when I run conda search libtiff it seems version 4.0 is the one installed).

Does anyone know what the problem is? I can't view the content of liblept.so, libtiff seems correctly installed... I've also tried commenting the conda change to PATH in ~/.bashrc but the result is the same...

Thank you !

zdenop commented 5 years ago
  1. Use English locale for reporting issues (building app).
  2. Provide details about your OS . IMO coda is not standard tool for installing c++/c dependencies in unix like system...
  3. If I got it right error is coming for leptonica. Did you build leptonica against static libtiff???
NolanBrb commented 5 years ago

Thanks for your answer !

  1. Sorry, I forgot to change the language beforehand. Here is the english version :

    //usr/local/lib/liblept.so: undefined reference to `TIFFGetVersion@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFReadDirectory@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFReadRGBAImageOriented@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFWriteScanline@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFGetField@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFScanlineSize@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFClose@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFClientOpen@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFGetFieldDefaulted@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFCleanup@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFOpen@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFSetSubDirectory@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFSetField@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFCurrentDirOffset@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFPrintDirectory@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFSetWarningHandler@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFSetErrorHandler@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFSetDirectory@LIBTIFF_4.0
    //usr/local/lib/liblept.so: undefined reference to `TIFFReadScanline@LIBTIFF_4.0
    collect2: error: ld returned 1 exit status
    Makefile:302: recipe for target 'release/qt-box-editor-1.12rc1' failed
    make: *** [release/qt-box-editor-1.12rc1] Error 1
  2. I'm using Ubuntu 18.04.2 LTS.

  3. I'm new to Unix so I don't really understand the question, sorry. I've built leptonica using the libtiff library installed with apt-get install libtiff-dev if that's of any help.

zdenop commented 5 years ago

leptonica and tesseract are part for Ubuntu, so I suggest to uninstall leptonica build from source and install version provided by Ubuntu. This can save you a lot of pain if you are new to unix/linux.

NolanBrb commented 5 years ago

I tried installing the version provided by Ubuntu and I still get the same error... Could it be linked to the fact that anaconda (which is also installed) has also installed a version of libtiff?

NolanBrb commented 5 years ago

(I'm saying this because I followed the steps from https://github.com/lagadic/visp/issues/109 which tackled a problem with the VISP build which looked similar. I still have the same problem though)

zdenop commented 5 years ago

Generally it is problem if you just follow some step without understanding what are you doing. Having multiple libs installed on system is not problem, if you know how to handle it... IMO You should uninstall everything you installed with coda + what you build from source and (re)install it via apt-get.

For this particular issue you may try to add -ltiff here in qt-box-editor.pro file: https://github.com/zdenop/qt-box-editor/blob/75a68b466868ba41ba2886caa796057403fe1901/qt-box-editor.pro#L99

and then to reconfigure and rebuild project.

NolanBrb commented 5 years ago

It worked, thank you !