Important: Please read the Qt Code of Conduct -

How to build qtserialport source code

  • I'm using debian for my OS system and with qt5.5.
    I have the issue when I qmak
    It will giving me this error.

    Project ERROR: Unknown module(s) in QT: serialport

    So I try to build serialport source code.
    I do it with this website.
    QT website

    But when I running "make" then it will give me this error.

    In file included from qserialport.cpp:41:0:
    qserialport_p.h:52:35: fatal error: private/qringbuffer_p.h: No such file or directory
     #include <private/qringbuffer_p.h>
    compilation terminated.
    Makefile:379: recipe for target '.obj/qserialport.o' failed
    make[2]: *** [.obj/qserialport.o] Error 1
    make[2]: Leaving directory '/home/qtserialport/src/serialport'
    Makefile:38: recipe for target 'sub-serialport-make_first' failed
    make[1]: *** [sub-serialport-make_first] Error 2
    make[1]: Leaving directory '/home/qtserialport/src'
    Makefile:40: recipe for target 'sub-src-make_first' failed
    make: *** [sub-src-make_first] Error 2

    I went to check is there any file name qringbuffer_p.h.
    And there is no file!

    I wondering why qt website will put a source code that missing some files?
    How can i fix this problem?
    Please help!
    Thanks in advanced.

  • Lifetime Qt Champion


    The QtSerialPort module is officially part of Qt since version 5.1. If you are using your distribution provided Qt, then just install the corresponding package.

    The clone you made is likely the 5.9 series.

  • @SGaist
    Actually I install this on my computer.

    apt-get install qt5-default

    Am I install the wrong one?

  • Lifetime Qt Champion

    No, but it doesn't install absolutely everything. You likely need to install libqt5serialport5-dev.

  • @SGaist
    Thank you so much I can qmake without any errors now!

Log in to reply