Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Simple problem: building QtSerialPort, no qlockfile.h
Forum Update on Monday, May 27th 2025

Simple problem: building QtSerialPort, no qlockfile.h

Scheduled Pinned Locked Moved Installation and Deployment
7 Posts 2 Posters 4.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    zeneslev
    wrote on last edited by
    #1

    Hi all. I am on Ubuntu 13.10, using QT Creator 2.7.1 (Qt version 5.0.2) to do some development. I want to use serial ports, so I am installing QtSerialPort using the official instructions (http://qt-project.org/wiki/QtSerialPort#c64518704ce0c0d5501a45763f464276). I am up to the step where I have to build the source, and when I try to make, I get a failure because qlockfile.h can't be found:

    @matt@mattdevel:~/serialport-build$ make
    cd src/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/matt/qtserialport/src/src.pro -o Makefile ) && make -f Makefile
    make[1]: Entering directory /home/matt/serialport-build/src' cd serialport/ && ( test -e Makefile || /usr/lib/x86_64-linux-gnu/qt5/bin/qmake /home/matt/qtserialport/src/serialport/serialport.pro -o Makefile ) && make -f Makefile make[2]: Entering directory /home/matt/serialport-build/src/serialport'
    g++ -c -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -O2 -std=c++0x -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQ_USE_APPMENU -DLINK_LIBUDEV -DQT_BUILD_SERIALPORT_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_CORE_LIB -I/usr/share/qt5/mkspecs/linux-g++-64 -I/home/matt/qtserialport/src/serialport -I/home/matt/qtserialport/src/serialport -I../../include -I../../include/QtSerialPort -I../../include/QtSerialPort/5.2.1 -I../../include/QtSerialPort/5.2.1/QtSerialPort -I/usr/include/qt5 -I/usr/include/qt5/QtCore -I/usr/include/qt5/QtCore/5.0.2 -I/usr/include/qt5/QtCore/5.0.2/QtCore -I.moc/release-shared -I. -o .obj/release-shared/qserialport.o /home/matt/qtserialport/src/serialport/qserialport.cpp
    In file included from /home/matt/qtserialport/src/serialport/qserialport.cpp:53:0:
    /home/matt/qtserialport/src/serialport/qserialport_unix_p.h:48:30: fatal error: QtCore/qlockfile.h: No such file or directory
    #include <QtCore/qlockfile.h>
    ^
    compilation terminated.
    make[2]: *** [.obj/release-shared/qserialport.o] Error 1
    make[2]: Leaving directory /home/matt/serialport-build/src/serialport' make[1]: *** [sub-serialport-make_first] Error 2 make[1]: Leaving directory /home/matt/serialport-build/src'
    make: *** [sub-src-make_first] Error 2
    @

    What gives? Is my version of QT already outdated? How can I resolve?

    Thank you

    1 Reply Last reply
    0
    • sierdzioS Offline
      sierdzioS Offline
      sierdzio
      Moderators
      wrote on last edited by
      #2

      QSerialPort was updated before being released with Qt 5.1. So right now, you need to either use Qt 5.1 (you don't need to install QtSerialPort, though, it's already there), or Qt 4.x.

      (Z(:^

      1 Reply Last reply
      0
      • Z Offline
        Z Offline
        zeneslev
        wrote on last edited by
        #3

        Thanks for the reply sierdzio. Is it possible to update to Qt 5.1 without updating my version of Qt Creator, or must I uninstall Qt Creator and download a new version of Qt Creator with Qt 5.1?

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #4

          Qt Creator can work with multiple versions of Qt. I don't know how it works with the SDK, since I don't use it, but you can definitely download and install Qt libraries separately.

          (Z(:^

          1 Reply Last reply
          0
          • Z Offline
            Z Offline
            zeneslev
            wrote on last edited by
            #5

            Thanks sierdzio,

            I have uninstalled my old version of Qt Creator that I got from the Ubuntu Software Center and I have downloaded and installed the latest Qt Creator 2.8.1 (Qt 5.1.1) from the qt website. The code still does not compile, and the only error I get is:

            @Unknown module(s) in QT: qserialport@

            This only happens when appending qserialport to the project file:

            @QT += core gui qserialport@

            The kit that I am using displays the Qt version correctly as: Qt 5.1.1 GCC 32bit

            Any ideas?

            Thanks

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #6

              This should work:
              @
              QT += core gui serialport
              @

              No need for that "q" in front of serialport :)

              (Z(:^

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                zeneslev
                wrote on last edited by
                #7

                Gah that was it! Problem solved. Thank you for your patience!

                1 Reply Last reply
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved