mooltipass / moolticute

Mooltipass crossplatform daemon/tools
GNU General Public License v3.0
141 stars 66 forks source link

QZXing.h: No such file or directory #1229

Closed tmontney closed 1 week ago

tmontney commented 1 week ago

Expected behavior

Build Moolticute per the instructions here and here.

Actual behavior

../src/utils/TOTPReader.h:5:10: fatal error: QZXing.h: No such file or directory
    5 | #include "QZXing.h"
      |          ^~~~~~~~~~
compilation terminated.

Step by step guide to reproduce the problem

Again, per the instructions followed above, the error occurs while running qmake-qt5 ../Moolticute.pro. Tried adding the source, per https://github.com/ftylitak/qzxing/wiki/Using-the-QZXing-through-the-source-code. Added include($$PWD/src/QZXing/QZXing.pri) to Moolticute.pro and re-ran qmake-qt5 ../Moolticute.pro. (Still get the same error.)

Editing src/utils/TOTPReader.h so that #include "QZXing.h" becomes #include "./QZXing/QZXing.h" got me farther:

/usr/bin/ld: TOTPReader.o: in function `TOTPReader::setupDecoder()':
TOTPReader.cpp:(.text+0x1d): undefined reference to `QZXing::setDecoder(unsigned int const&)'
/usr/bin/ld: TOTPReader.cpp:(.text+0x2a): undefined reference to `QZXing::setSourceFilterType(unsigned int)'
/usr/bin/ld: TOTPReader.cpp:(.text+0x37): undefined reference to `QZXing::setTryHarderBehaviour(unsigned int)'
/usr/bin/ld: TOTPReader.o: in function `TOTPReader::getQRCodeResult(QString const&)':
TOTPReader.cpp:(.text+0x7db): undefined reference to `QZXing::decodeImageFromFile(QString const&, int, int, bool)'
/usr/bin/ld: TOTPReader.o: in function `TOTPReader::getQRCodeResult(QImage const&)':
TOTPReader.cpp:(.text+0x87b): undefined reference to `QZXing::decodeImage(QImage const&, int, int, bool)'
/usr/bin/ld: TOTPReader.o: in function `_GLOBAL__sub_I_TOTPReader.cpp':
TOTPReader.cpp:(.text.startup+0x18): undefined reference to `QZXing::QZXing(QObject*)'
/usr/bin/ld: TOTPReader.cpp:(.text.startup+0x1f): undefined reference to `QZXing::~QZXing()'
collect2: error: ld returned 1 exit status
make[1]: *** [Makefile.gui:529: moolticute] Error 1

Moolticute Version

1.03.0

Operating System

Mention if you are using either:

Mooltipass Device

Mention if you are using either:

tmontney commented 1 week ago

Solution is to clone recursively, as the repo contains submodules: git clone https://github.com/mooltipass/moolticute.git --recurse-submodules -j8

Can the docs be updated to reflect this?