Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Project ERROR: Unknown module(s) in QT: serialport (Raspbian Jessie)
Forum Update on Monday, May 27th 2025

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

Scheduled Pinned Locked Moved Solved Mobile and Embedded
raspberry pi 2serialportjessieraspbian
8 Posts 3 Posters 20.6k 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.
  • P Offline
    P Offline
    pbdot
    wrote on last edited by
    #1

    I am trying to compile a Qt project that uses serialport module. I have installed the module using:

    sudo apt-get install libqt5serialport5
    sudo apt-get install libqt5serialport5-dev
    

    The serialport is added in my .pro file:

    QT += core gui network serialport
    

    and the module is included in my header file:

    #include < QtSerialPort/QSerialPort>
    

    But when I compile, it says:

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

    Any idea what's wrong?

    alt text

    jsulmJ 1 Reply Last reply
    0
    • P pbdot

      I am trying to compile a Qt project that uses serialport module. I have installed the module using:

      sudo apt-get install libqt5serialport5
      sudo apt-get install libqt5serialport5-dev
      

      The serialport is added in my .pro file:

      QT += core gui network serialport
      

      and the module is included in my header file:

      #include < QtSerialPort/QSerialPort>
      

      But when I compile, it says:

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

      Any idea what's wrong?

      alt text

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @pbdot You installed libqt5serialport5 from the Linux distribution, but the qt in /usr/local/qt5 is for sure not the one from the distribution. Did you install qt5 by yourself in /usr/local/qt5? If so then you have to make sure libqt5serialport5 is installed there.

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • P Offline
        P Offline
        pbdot
        wrote on last edited by
        #3

        Thanks @jsulm

        Qt was installed through Raspbian package manager using:

        sudo apt-get install qt5-qmake
        sudo apt-get install libqt5
        

        I can compile other project without issue, for example project using QNetwork which is included by default. Just not this one with QSerialPort.

        How do I make sure libqt5serialport5 is there in /usr/local/qt5?

        jsulmJ 1 Reply Last reply
        0
        • P pbdot

          Thanks @jsulm

          Qt was installed through Raspbian package manager using:

          sudo apt-get install qt5-qmake
          sudo apt-get install libqt5
          

          I can compile other project without issue, for example project using QNetwork which is included by default. Just not this one with QSerialPort.

          How do I make sure libqt5serialport5 is there in /usr/local/qt5?

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @pbdot I'm not sure Raspbian is installing Qt in /usr/local/qt5, at least I wouldn't expect this. Are you sure /usr/local/qt5 is Qt from Raspbian you installed?
          What does (in a terminal)

          which qmake
          

          say?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • P Offline
            P Offline
            pbdot
            wrote on last edited by
            #5

            Running which qmake returns the following:

            pi@raspberrypi:~/SerialSend$ which qmake
            /usr/bin/qmake
            pi@raspberrypi:~/SerialSend$ qmake
            qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake': No such file or directory
            

            Hm. I think I made some mistake but I am a bit hazy now why I ended up with 2 qmake:

            • one in /usr/local/qt5 which is qt version 5
            • and another in /usr/bin/qmake which seems to be qt version 4 but somehow didn't work
            1 Reply Last reply
            0
            • P Offline
              P Offline
              pbdot
              wrote on last edited by
              #6

              It seems that there are 2 qmake in the system:

              • /usr/bin/qmake : system seems to recognize this in the path
                if I run it, it will complain "qmake: could not exec '/usr/lib/arm-linux-gnueabihf/qt4/bin/qmake': No such file or directory"
              • /usr/local/qt5/bin/qmake : system doesn't recognize it but it will run just fine if I specify full path like:
                /usr/local/qt5/bin/qmake
                make clean
                make

              I purged the old one by:

              > sudo apt purge qt4*
              

              After this, the system can recognize the qt5 qmake which is located at /usr/local/qt5

              I then reinstalled serialport module:

              > sudo apt-get install libqt5serialport5
              > sudo apt-get install libqt5serialport5-dev
              

              But now if run qmake, it complains:

              qmake: could not find a Qt installation of ''
              

              I checked my .bashrc file and at the end of the file, it has:

              export LD_LIBRARY_PATH=/usr/local/qt5/lib/
              export PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/qt5/bin
              
              1 Reply Last reply
              0
              • P Offline
                P Offline
                pbdot
                wrote on last edited by pbdot
                #7

                I am able to compile the project with serialport now after reinstalling qt5

                > sudo apt-get install qt5-default
                

                But I've got different error now which I think is a different issue altogether.

                Unable to query physical screen size, defaulting to 100 dpi.

                To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).
                QOpenGLShaderProgram: could not create shader program
                QOpenGLShader: could not create shader
                Could not link shader program:
                 ""
                QOpenGLShaderProgram: could not create shader program
                QOpenGLShader: could not create shader
                QOpenGLShaderProgram::uniformLocation( texture ): shader program is not linked
                
                1 Reply Last reply
                0
                • I Offline
                  I Offline
                  IRBaboon
                  wrote on last edited by
                  #8

                  This one:

                  sudo apt-get install libqt5serialport5
                  sudo apt-get install libqt5serialport5-dev
                  
                  

                  Solved the Issue for me.

                  1 Reply Last reply
                  1

                  • Login

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