Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Installation QtSerialport



  • Hello,
    I try to install QtSerialport following this:
    http://qt-project.org/wiki/QtSerialPort

    First, the command
    git clone git: //gitorious.org/qt/qtserialport.git
    gives me the following result:
    fatal: Could not read from remote repository.
    Please make sour you-have the proper access rights
    and the repository exists.

    So I download the archive:
    http://qt.gitorious.org/qt/qtserialport/archive-tarball/stable

    After extraction and the creation of the serialport-build directory I try this:
    qmake ../serialport-src/qtserialport.pro, no message ok
    Then:
    make: an error message:
    In file included from /.../qt-qtserialport/src/serialport/qserialport.cpp:45:0:
    /home/francois/qt-qtserialport/src/serialport/qserialport.h:48:44: fatal error: QtSerialPort / qserialportglobal.h: No such file or folder of this type
    #include <QtSerialPort / qserialportglobal.h>

    I use: QT5 / ubuntu 14.04.1
    qmake --version
    QMake version 3.0
    Using Qt 5.2.1 in / usr / lib / i386-linux-gnu

    Thanks


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Since you are using Qt 5.2.1 why don't you use the QtSerialPort module that comes with it ? It's been in Qt since 5.1



  • Thank you for your reply.

    I installed QT5 using QtCreator package on ubuntu and I have no trace of QtSerialPort include files in the /usr/include/qt5 !

    The version of QtCreator package: 3.0.1-0ubuntu4
    Qt Creator 3.0.1
    Based on Qt 5.2.1 (GCC 4.8.2, 32 bit)

    What is the problem?
    thank you


  • Moderators

    @bsuarez said:

    I installed QT5 using QtCreator package on ubuntu

    Qt Creator is only the IDE. You need to install Qt development libraries.

    The recommended way to get the libraries is from the official website: http://www.qt.io/download-open-source/

    However, you can get packages from the Ubuntu Software Center too if you want. Be aware that there are many separate packages, such as libqt5serialport5-dev.



  • Hi,

    I'm want to use the QSerialPort Library for QT 5.7. But I cant find any downloads and it doesn't seem to be preinstalled. I'm working on a win pc.
    Can you tell me where I can download the QSerialPort library?
    Thanks!


  • Lifetime Qt Champion

    Hi,

    It comes with your installation of Qt



  • Hi,

    but when I try #include <QSerialPort> then I get an error "No such file or directory." I addes QT += serialport.
    On the web I found something like #include <QtSerialPort/QtSerialPort>. But is it the same library? And does it have an info library too?
    Sorry for beeing such a newbie :D


  • Lifetime Qt Champion

    @Smileede How did you install Qt?
    And what do you mean by "info library"?



  • Thanks for your response!
    I did the installation via an online installer. Or what do you mean?
    The "info library" is the QSerialPortInfo library. Sorry for beeing unexact!


  • Lifetime Qt Champion

    @Smileede Can you check whether you have the QtSerial header files? See in Qt/5.7/mingw53_32/include/QtSerialPort. Replace mingw53_32 with what ever Qt version you installed. Maybe something went wrong during installation.



  • Yes, it is there! Ahh, now I got it! If I type #include <QTSerialPort/qseriaport.h> it does work :)
    But I can also include QTSerialPort/QtSerialPort. Is there any difference between QtSerialPort and QSerialPort?

    Thank you for your help!


  • Lifetime Qt Champion

    There's always one basic that should be done: did you re-run qmake after you added QT += serialport to your .pro file ?


Log in to reply