QSerialPort not found by qmake in CLI



  • I´m using the the class QSerialPort and my app is running Ok.

    This compilation is inside QtCreator.

    I need to make a deploy (I´m using linuxdeployqt) it and my first action is:

    luis@hal9000:/mnt/midia4/prj/qt/Controle$ qmake PREFIX=/usr
    Project ERROR: Unknown module(s) in QT: serialport

    I´m following the instructions from http://doc.qt.io/qt-5/qtserialport-index.html

    My file have this include:
    #include <QtSerialPort/QtSerialPort>

    My .pro file include
    QT += core gui sql printsupport xml serialport

    The compilation and results are ok ( inside QtCreator ).

    What I need to do?

    Thanks


  • Lifetime Qt Champion

    Hi,

    What version of Qt are you using ?

    From the looks of it, since you are calling qmake like you are, you are likely getting a Qt 4 from your Linux distribution.



  • Hi, I´m using debian 8 and

    Qt Creator 4.3.0
    Based on Qt 5.8.0 (GCC 5.3.1 20160406 (Red Hat 5.3.1-6), 64 bit)

    Built on May 23 2017 11:09:03

    From revision 7482d8a152

    luis@hal9000:/mnt/midia4/prj/qt/Controle$ qmake --version
    QMake version 3.0
    Using Qt version 5.3.2 in /usr/lib/x86_64-linux-gnu

    I´m tying to deploy it using linuxdeployqt script....

    It was working until QserialPort....


  • Moderators

    @Guapo Are you really using Qt from Debian or did you install Qt by yourself? If you installed it by yourself then try to use absolute path to qmake instead of only using qmake as using qmake will call the one from Debian Qt.


  • Lifetime Qt Champion

    Like I wrote before, you are using your distribution Qt for which you didn’t install the QtSerialPort package.

    But as already suggested, use the full path to your Qt installation if you used one of the installers.



  • Excuse me, but I think that I´m not understand you.

    I did install my Qt from installer online.

    I´m found the QSerialPort from the examples apps and I´m using SerialPortWriter class from cwriteasync example.

    1)qmake
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ which qmake
    /usr/bin/qmake

    so I used:
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ /opt/Qt/5.8/gcc_64/bin/qmake PREFIX=/usr
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$

    no message -> ok

    2)next step is run linuxdeployqt from probonopd

    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
    Not using FHS-like mode
    app-binary: "/mnt/midia4/prj/qt/deploy/Controle/Controle"
    appDirPath: "/mnt/midia4/prj/qt/deploy/Controle"
    relativeBinPath: "Controle"
    ERROR: ldd outputLine: "libQt5SerialPort.so.5 => not found"
    ERROR: Please ensure that all libraries can be found by ldd. Aborting.
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$

    3)Looking at /opt/Qt/5.8/gcc_64/lib

    luis@hal9000:/opt/Qt/5.8/gcc_64/lib$ ldd libQt5SerialPort.so
    linux-vdso.so.1 (0x00007ffd72b77000)
    libQt5Core.so.5 (0x00007fef0425c000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fef0403f000)
    libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fef03d34000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fef03a33000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fef0381d000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fef03472000)
    libicui18n.so.56 (0x00007fef02fd9000)
    libicuuc.so.56 (0x00007fef02c21000)
    libicudata.so.56 (0x00007fef0123e000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fef0103a000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fef00e32000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fef00c17000)
    libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fef00a15000)
    libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fef00706000)
    /lib64/ld-linux-x86-64.so.2 (0x00007fef04b95000)
    libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fef00498000)
    luis@hal9000:/opt/Qt/5.8/gcc_64/lib$

    there is no dependency problem.

    luis@hal9000:/opt/Qt/5.8/gcc_64/lib$ ls -la libQt5SerialPort.so*
    lrwxrwxrwx 1 root root 25 Mai 26 2017 libQt5SerialPort.so -> libQt5SerialPort.so.5.8.0
    lrwxrwxrwx 1 root root 25 Mai 26 2017 libQt5SerialPort.so.5 -> libQt5SerialPort.so.5.8.0
    lrwxrwxrwx 1 root root 25 Mai 26 2017 libQt5SerialPort.so.5.8 -> libQt5SerialPort.so.5.8.0
    -rwxr-xr-x 1 root root 101512 Jan 18 2017 libQt5SerialPort.so.5.8.0

    this is from Qt instalation.

    5)I did try follow these instructions here: https://wiki.qt.io/Qt_Serial_Port
    "Build and install from QtCreator"

    as root, run qtcreator and build QtSerialPort ( I think! )....because there is no errors:

    08:56:18: Running steps for project serialport...
    08:56:18: Starting: "/usr/bin/make" clean
    cd cenumerator/ && ( test -e Makefile || /opt/Qt/5.8/gcc_64/bin/qmake -o Makefile /opt/Qt/Examples/Qt-5.8/serialport/cenumerator/cenumerator.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ) && /usr/bin/make -f Makefile clean
    make[1]: Entering directory '/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/cenumerator'
    rm -f moc_predefs.h
    rm -f main.o
    rm -f *~ core *.core
    make[1]: Leaving directory '/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/cenumerator'
    ...
    [there are a lot of lines here]
    ...

    cd slave/ && ( test -e Makefile || /opt/Qt/5.8/gcc_64/bin/qmake -o Makefile /opt/Qt/Examples/Qt-5.8/serialport/slave/slave.pro -spec linux-g++ CONFIG+=debug CONFIG+=qml_debug ) && /usr/bin/make -f Makefile install
    make[1]: Entering directory '/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/slave'
    install -m 755 -p slave /opt/Qt/Examples/Qt-5.8/serialport/slave/slave
    make[1]: Leaving directory '/opt/Qt/Examples/Qt-5.8/build-serialport-Desktop_Qt_5_8_0_GCC_64bit-Debug/slave'
    08:57:33: The process "/usr/bin/make" exited normally.
    08:57:33: Elapsed time: 01:15.

    6)I repeat steps (1) and (2) again

    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ /opt/Qt/5.8/gcc_64/bin/qmake PREFIX=/usr
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
    Not using FHS-like mode
    app-binary: "/mnt/midia4/prj/qt/deploy/Controle/Controle"
    appDirPath: "/mnt/midia4/prj/qt/deploy/Controle"
    relativeBinPath: "Controle"
    ERROR: ldd outputLine: "libQt5SerialPort.so.5 => not found"
    ERROR: Please ensure that all libraries can be found by ldd. Aborting.
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
    Not using FHS-like mode
    app-binary: "/mnt/midia4/prj/qt/deploy/Controle/Controle"
    appDirPath: "/mnt/midia4/prj/qt/deploy/Controle"
    relativeBinPath: "Controle"
    ERROR: ldd outputLine: "libQt5SerialPort.so.5 => not found"
    ERROR: Please ensure that all libraries can be found by ldd. Aborting.
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ /opt/Qt/5.8/gcc_64/bin/qmake PREFIX=/usr
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$ ../linuxdeployqt*.AppImage Controle -bundle-non-qt-libs
    Not using FHS-like mode
    app-binary: "/mnt/midia4/prj/qt/deploy/Controle/Controle"
    appDirPath: "/mnt/midia4/prj/qt/deploy/Controle"
    relativeBinPath: "Controle"
    ERROR: ldd outputLine: "libQt5SerialPort.so.5 => not found"
    ERROR: Please ensure that all libraries can be found by ldd. Aborting.
    luis@hal9000:/mnt/midia4/prj/qt/deploy/Controle$

    These steps was ok to deploy this project until use QSerialPort.

    Excuse me for these information, but like I said before I didnt understand you and i put all informations.



  • @Guapo I guess your problem is - and what the others already told you - that /usr/bin/qmake is not the qmake from Qt 5.8.

    that one should be /opt/Qt/5.8/gcc_64/bin/qmake and you need to call it with full path. maybe clean all build objects first.

    Regards


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.