Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Problems when adding serialport module in Qt project
Forum Updated to NodeBB v4.3 + New Features

Problems when adding serialport module in Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
serialportqserialport
58 Posts 7 Posters 31.4k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    douglas
    wrote on 13 Jun 2018, 06:54 last edited by
    #1

    Hi,
    I need to use QSerialport in my Qt project. Following the official documentation, I added

    QT       += serialport
    

    to my .pro file. After doing this, the build always fails, giving the error: "Unknown module(s) in QT: serialport". I am using Qt Creator 4.1.0 based on Qt 5.6.1. What am I missing?
    Thank you.

    J 1 Reply Last reply 13 Jun 2018, 06:56
    0
    • D douglas
      13 Jun 2018, 06:54

      Hi,
      I need to use QSerialport in my Qt project. Following the official documentation, I added

      QT       += serialport
      

      to my .pro file. After doing this, the build always fails, giving the error: "Unknown module(s) in QT: serialport". I am using Qt Creator 4.1.0 based on Qt 5.6.1. What am I missing?
      Thank you.

      J Offline
      J Offline
      J.Hilk
      Moderators
      wrote on 13 Jun 2018, 06:56 last edited by
      #2

      Hi @douglas

      2 Questions:

      • did you rerun qmake after changing your .pro file?
      • for what OS are you trying to make the program? serialport is not available for all platforms

      Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


      Q: What's that?
      A: It's blue light.
      Q: What does it do?
      A: It turns blue.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        douglas
        wrote on 13 Jun 2018, 07:05 last edited by
        #3

        Hi,
        when I run qmake (Build menu -> Run qmake), I get the same error. I am trying to build an application for a device running Linux Yocto, and my host PC, in which Qt Creator is installed, has Uuntu 16.04 as O.S.
        My .pro file first lines looks like the following:

        QT       += core gui printsupport
        QT       += serialport
        

        Thank you!

        A 1 Reply Last reply 13 Jun 2018, 07:43
        0
        • D douglas
          13 Jun 2018, 07:05

          Hi,
          when I run qmake (Build menu -> Run qmake), I get the same error. I am trying to build an application for a device running Linux Yocto, and my host PC, in which Qt Creator is installed, has Uuntu 16.04 as O.S.
          My .pro file first lines looks like the following:

          QT       += core gui printsupport
          QT       += serialport
          

          Thank you!

          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 13 Jun 2018, 07:43 last edited by
          #4

          @douglas

          • Which Qt version do you intend use?
          • How did you install Qt? If you installed with apt, you may add the serialport module explicitely.

          Qt has to stay free or it will die.

          D 1 Reply Last reply 13 Jun 2018, 07:47
          1
          • A aha_1980
            13 Jun 2018, 07:43

            @douglas

            • Which Qt version do you intend use?
            • How did you install Qt? If you installed with apt, you may add the serialport module explicitely.
            D Offline
            D Offline
            douglas
            wrote on 13 Jun 2018, 07:47 last edited by
            #5

            @aha_1980 I am using Qt 5.6.1. I installed Qt creator with apt. What do you mean with "add serialport explicitely"?
            Thank you!

            K 1 Reply Last reply 13 Jun 2018, 07:53
            0
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 13 Jun 2018, 07:50 last edited by
              #6

              Hi,

              What @aha_1980 asked was whether you also installed the Qt5 SerialPort package using apt.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              1
              • D douglas
                13 Jun 2018, 07:47

                @aha_1980 I am using Qt 5.6.1. I installed Qt creator with apt. What do you mean with "add serialport explicitely"?
                Thank you!

                K Offline
                K Offline
                KillerSmath
                wrote on 13 Jun 2018, 07:53 last edited by KillerSmath
                #7

                @douglas
                @aha_1980 told you need to install the packages individualy.

                sudo apt-get install libqt5serialport5
                sudo apt-get install libqt5serialport5-dev
                
                D 1 Reply Last reply 13 Jun 2018, 07:57
                3
                • K KillerSmath
                  13 Jun 2018, 07:53

                  @douglas
                  @aha_1980 told you need to install the packages individualy.

                  sudo apt-get install libqt5serialport5
                  sudo apt-get install libqt5serialport5-dev
                  
                  D Offline
                  D Offline
                  douglas
                  wrote on 13 Jun 2018, 07:57 last edited by
                  #8

                  @KillerSmath I installed those packages via Software Center. Perhaps have I to uninstall them and re-install via apt-get?
                  Could it be the reason for the "unknown module" error?

                  K 1 Reply Last reply 13 Jun 2018, 08:15
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 13 Jun 2018, 08:07 last edited by
                    #9

                    Silly question: are you sure you are using Qt 5 and not Qt 4 for your project ?

                    Interested in AI ? www.idiap.ch
                    Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                    D 1 Reply Last reply 13 Jun 2018, 08:13
                    0
                    • S SGaist
                      13 Jun 2018, 08:07

                      Silly question: are you sure you are using Qt 5 and not Qt 4 for your project ?

                      D Offline
                      D Offline
                      douglas
                      wrote on 13 Jun 2018, 08:13 last edited by
                      #10

                      @SGaist Yes, the Help menu from Qt Creator reports:
                      0_1528877526983_c9026808-fe20-4a8b-99f4-31be90b3f4e8-immagine.png
                      In fact, I read that serialport module was not included in Qt4, but it seems I am using Qt5, this is the reason why I can't understand that build error..

                      1 Reply Last reply
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 13 Jun 2018, 08:14 last edited by
                        #11

                        That's just the information about Qt Creator.

                        You have to check the Kit you are using to build your application and which version of Qt it is using.

                        Interested in AI ? www.idiap.ch
                        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                        D 1 Reply Last reply 13 Jun 2018, 08:23
                        0
                        • D douglas
                          13 Jun 2018, 07:57

                          @KillerSmath I installed those packages via Software Center. Perhaps have I to uninstall them and re-install via apt-get?
                          Could it be the reason for the "unknown module" error?

                          K Offline
                          K Offline
                          KillerSmath
                          wrote on 13 Jun 2018, 08:15 last edited by KillerSmath
                          #12

                          @douglas
                          If nothing works, you can try to manage the packages from MaintenanceTool of QtCreator

                            1. <Qt Folder>/MaintenanceTool
                            1. Add or remove Components
                            1. Expand your Qt version
                            1. Expand Source Components
                            1. Select the Qt Source Package
                            1. Next, Install
                          1 Reply Last reply
                          0
                          • S SGaist
                            13 Jun 2018, 08:14

                            That's just the information about Qt Creator.

                            You have to check the Kit you are using to build your application and which version of Qt it is using.

                            D Offline
                            D Offline
                            douglas
                            wrote on 13 Jun 2018, 08:23 last edited by
                            #13

                            @SGaist how can I make sure of the Qt version I am using in my project?

                            J 1 Reply Last reply 13 Jun 2018, 08:29
                            0
                            • K Offline
                              K Offline
                              KillerSmath
                              wrote on 13 Jun 2018, 08:28 last edited by
                              #14
                              This post is deleted!
                              1 Reply Last reply
                              0
                              • D douglas
                                13 Jun 2018, 08:23

                                @SGaist how can I make sure of the Qt version I am using in my project?

                                J Offline
                                J Offline
                                J.Hilk
                                Moderators
                                wrote on 13 Jun 2018, 08:29 last edited by
                                #15

                                @douglas
                                In QtCreator go to Tools -> Options -> build & run and check your kits

                                0_1528878528527_b34127d9-9d4c-4f4e-896b-57a4a318f333-image.png

                                In sidebar under the "Projects tab" you can select one of your installed kits:
                                0_1528878587108_07154278-cd0d-49d8-b11f-48a5441b9854-image.png


                                Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                Q: What's that?
                                A: It's blue light.
                                Q: What does it do?
                                A: It turns blue.

                                D 1 Reply Last reply 13 Jun 2018, 08:45
                                2
                                • J J.Hilk
                                  13 Jun 2018, 08:29

                                  @douglas
                                  In QtCreator go to Tools -> Options -> build & run and check your kits

                                  0_1528878528527_b34127d9-9d4c-4f4e-896b-57a4a318f333-image.png

                                  In sidebar under the "Projects tab" you can select one of your installed kits:
                                  0_1528878587108_07154278-cd0d-49d8-b11f-48a5441b9854-image.png

                                  D Offline
                                  D Offline
                                  douglas
                                  wrote on 13 Jun 2018, 08:45 last edited by
                                  #16

                                  @J.Hilk My environment is a bit different; I can't find informations about the version..
                                  0_1528879450246_5ef95ff2-c072-4d13-894d-4b7af5bb41e7-immagine.png

                                  J 1 Reply Last reply 13 Jun 2018, 08:48
                                  0
                                  • D douglas
                                    13 Jun 2018, 08:45

                                    @J.Hilk My environment is a bit different; I can't find informations about the version..
                                    0_1528879450246_5ef95ff2-c072-4d13-894d-4b7af5bb41e7-immagine.png

                                    J Offline
                                    J Offline
                                    J.Hilk
                                    Moderators
                                    wrote on 13 Jun 2018, 08:48 last edited by
                                    #17

                                    @douglas
                                    from what one can see, it at least seems to be a version of Qt5, for more information press the "Manage kits" button


                                    Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                    Q: What's that?
                                    A: It's blue light.
                                    Q: What does it do?
                                    A: It turns blue.

                                    D 1 Reply Last reply 13 Jun 2018, 09:34
                                    0
                                    • J J.Hilk
                                      13 Jun 2018, 08:48

                                      @douglas
                                      from what one can see, it at least seems to be a version of Qt5, for more information press the "Manage kits" button

                                      D Offline
                                      D Offline
                                      douglas
                                      wrote on 13 Jun 2018, 09:34 last edited by
                                      #18

                                      @J.Hilk The Manage Kit button shows the settings reported below, in which I can't find any information regarding the Qt version in use:
                                      0_1528882243058_5fd714c7-c885-44b9-9911-43fbdc2ec394-immagine.png

                                      If from terminal I write

                                      $ qmake --version
                                      

                                      I obtain the following:

                                      qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
                                      

                                      Is it relevant the "qt4" shown in that prompt?
                                      Thanks.

                                      J 1 Reply Last reply 13 Jun 2018, 09:38
                                      0
                                      • D douglas
                                        13 Jun 2018, 09:34

                                        @J.Hilk The Manage Kit button shows the settings reported below, in which I can't find any information regarding the Qt version in use:
                                        0_1528882243058_5fd714c7-c885-44b9-9911-43fbdc2ec394-immagine.png

                                        If from terminal I write

                                        $ qmake --version
                                        

                                        I obtain the following:

                                        qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
                                        

                                        Is it relevant the "qt4" shown in that prompt?
                                        Thanks.

                                        J Offline
                                        J Offline
                                        J.Hilk
                                        Moderators
                                        wrote on 13 Jun 2018, 09:38 last edited by
                                        #19

                                        @douglas
                                        well, there we have your problem

                                        0_1528882573156_25bb3434-9c9d-43e1-91e3-d1d195bd5377-image.png

                                        you have no QtLibary selected to your kit. Se if you can actually select a QtVersion from that dropdown menu. If you can't than you need to install an actual qt version.

                                        I would recommend the online installer from the Webside.


                                        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


                                        Q: What's that?
                                        A: It's blue light.
                                        Q: What does it do?
                                        A: It turns blue.

                                        D 1 Reply Last reply 13 Jun 2018, 10:07
                                        1
                                        • J J.Hilk
                                          13 Jun 2018, 09:38

                                          @douglas
                                          well, there we have your problem

                                          0_1528882573156_25bb3434-9c9d-43e1-91e3-d1d195bd5377-image.png

                                          you have no QtLibary selected to your kit. Se if you can actually select a QtVersion from that dropdown menu. If you can't than you need to install an actual qt version.

                                          I would recommend the online installer from the Webside.

                                          D Offline
                                          D Offline
                                          douglas
                                          wrote on 13 Jun 2018, 10:07 last edited by
                                          #20

                                          @J.Hilk Thanks, I added the version as shown below:
                                          0_1528884090398_f92cd759-ed4c-403b-9ff6-6b0378c19b45-immagine.png
                                          Now, since I should have Qt5, I added the serialport support in my .pro file, but the "unknow module" error still remains. I saw another thing that seems not so clear to me: I run Qt Creator from linux terminal, and when I open my project the terminal shows the following lines, marked in red, in which appears Qt4. Can this be related to the serialport module error?
                                          0_1528884382827_59039698-8cd0-49c5-8a93-a8c89abf87c9-immagine.png
                                          thank you again.

                                          jsulmJ 1 Reply Last reply 13 Jun 2018, 11:47
                                          0

                                          8/58

                                          13 Jun 2018, 07:57

                                          topic:navigator.unread, 50
                                          • Login

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