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 Update on Monday, May 27th 2025

Problems when adding serialport module in Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
serialportqserialport
58 Posts 7 Posters 31.1k 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.
  • J.HilkJ J.Hilk

    @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

    douglasD Offline
    douglasD Offline
    douglas
    wrote on 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.HilkJ 1 Reply Last reply
    0
    • douglasD douglas

      @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.HilkJ Offline
      J.HilkJ Offline
      J.Hilk
      Moderators
      wrote on 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.

      douglasD 1 Reply Last reply
      0
      • J.HilkJ J.Hilk

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

        douglasD Offline
        douglasD Offline
        douglas
        wrote on 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.HilkJ 1 Reply Last reply
        0
        • douglasD douglas

          @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.HilkJ Offline
          J.HilkJ Offline
          J.Hilk
          Moderators
          wrote on 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.

          douglasD 1 Reply Last reply
          1
          • J.HilkJ J.Hilk

            @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.

            douglasD Offline
            douglasD Offline
            douglas
            wrote on 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
            0
            • douglasD douglas

              @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 Offline
              jsulmJ Offline
              jsulm
              Lifetime Qt Champion
              wrote on last edited by
              #21

              @douglas Above you said you installed Qt 5.6, now you selected Qt 5.7.1
              Which Qt version do you really want to use and did you install QtSearialPort for Qt 5.7.1?

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

              douglasD 1 Reply Last reply
              0
              • jsulmJ jsulm

                @douglas Above you said you installed Qt 5.6, now you selected Qt 5.7.1
                Which Qt version do you really want to use and did you install QtSearialPort for Qt 5.7.1?

                douglasD Offline
                douglasD Offline
                douglas
                wrote on last edited by
                #22

                @jsulm when I spoke about Qt 5.6 I was referring to the "About Qt Creator" window shown above. Now I selected Qt 5.7.1 as the version for my kit. But the serialport module isn't recognized yet. What I should do to correctly install QtSerialPort for my actual version?

                Pablo J. RoginaP 1 Reply Last reply
                0
                • douglasD douglas

                  @jsulm when I spoke about Qt 5.6 I was referring to the "About Qt Creator" window shown above. Now I selected Qt 5.7.1 as the version for my kit. But the serialport module isn't recognized yet. What I should do to correctly install QtSerialPort for my actual version?

                  Pablo J. RoginaP Offline
                  Pablo J. RoginaP Offline
                  Pablo J. Rogina
                  wrote on last edited by
                  #23

                  @douglas could it be possible that you start from scratch with a clean installation of Qt, ideally latest version 5.11? you may try in a virtual machine just in case.

                  Upvote the answer(s) that helped you solve the issue
                  Use "Topic Tools" button to mark your post as Solved
                  Add screenshots via postimage.org
                  Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                  1 Reply Last reply
                  1
                  • SGaistS Offline
                    SGaistS Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on last edited by
                    #24

                    Is it me or are you trying to build your project for an embedded system ?
                    I see that you are trying to use an arm compiler, did you cross-compile Qt for your device ?

                    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
                    4
                    • douglasD Offline
                      douglasD Offline
                      douglas
                      wrote on last edited by
                      #25

                      @SGaist Yes, my target device runs Linux Yocto. Can this affect the serialport module I am trying to install?

                      1 Reply Last reply
                      0
                      • SGaistS Offline
                        SGaistS Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on last edited by
                        #26

                        Sur it does, you are trying to install the desktop version of the driver and then, use it to do cross-compilation.

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

                        douglasD 1 Reply Last reply
                        2
                        • SGaistS SGaist

                          Sur it does, you are trying to install the desktop version of the driver and then, use it to do cross-compilation.

                          douglasD Offline
                          douglasD Offline
                          douglas
                          wrote on last edited by
                          #27

                          @SGaist I see. So, if I need to cross-compile, which steps should I follow in order to use the serialport in my project?
                          Are there different libraries or drivers I need to install on my host PC?
                          The target linux embedded device runs Linux Yocto.

                          jsulmJ 1 Reply Last reply
                          0
                          • douglasD douglas

                            @SGaist I see. So, if I need to cross-compile, which steps should I follow in order to use the serialport in my project?
                            Are there different libraries or drivers I need to install on my host PC?
                            The target linux embedded device runs Linux Yocto.

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

                            @douglas You need Qt (together with Qt Searial Port) cross compiled for your device

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

                            douglasD 1 Reply Last reply
                            2
                            • jsulmJ jsulm

                              @douglas You need Qt (together with Qt Searial Port) cross compiled for your device

                              douglasD Offline
                              douglasD Offline
                              douglas
                              wrote on last edited by
                              #29

                              @jsulm I already set up the project in order to cross-compile for my target: in fact, I have already managed to run my application on the target device. The problem is the serial port module: I did not succeeded in including it into my project. Are there any particular hints to follow in the case of cross-compilation?
                              Thank you!

                              jsulmJ J.HilkJ 2 Replies Last reply
                              0
                              • douglasD douglas

                                @jsulm I already set up the project in order to cross-compile for my target: in fact, I have already managed to run my application on the target device. The problem is the serial port module: I did not succeeded in including it into my project. Are there any particular hints to follow in the case of cross-compilation?
                                Thank you!

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

                                @douglas Did you cross compile Qt serial port module?

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

                                1 Reply Last reply
                                1
                                • douglasD douglas

                                  @jsulm I already set up the project in order to cross-compile for my target: in fact, I have already managed to run my application on the target device. The problem is the serial port module: I did not succeeded in including it into my project. Are there any particular hints to follow in the case of cross-compilation?
                                  Thank you!

                                  J.HilkJ Offline
                                  J.HilkJ Offline
                                  J.Hilk
                                  Moderators
                                  wrote on last edited by
                                  #31

                                  @douglas
                                  How did you cross-compile for your target device?

                                  I would asume you cloned the qt-sources from git or something similar. However did you crosscompile the whole Framework or only part of it? For any Qt-Program to run you'll need only QtBase, however serialport is a plugin and needs to be compiled seperately.


                                  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.

                                  douglasD 1 Reply Last reply
                                  0
                                  • J.HilkJ J.Hilk

                                    @douglas
                                    How did you cross-compile for your target device?

                                    I would asume you cloned the qt-sources from git or something similar. However did you crosscompile the whole Framework or only part of it? For any Qt-Program to run you'll need only QtBase, however serialport is a plugin and needs to be compiled seperately.

                                    douglasD Offline
                                    douglasD Offline
                                    douglas
                                    wrote on last edited by
                                    #32

                                    @J.Hilk Where can I found the procedure to cross-compile the serial port module?
                                    Thank you.

                                    J.HilkJ 1 Reply Last reply
                                    0
                                    • douglasD douglas

                                      @J.Hilk Where can I found the procedure to cross-compile the serial port module?
                                      Thank you.

                                      J.HilkJ Offline
                                      J.HilkJ Offline
                                      J.Hilk
                                      Moderators
                                      wrote on last edited by
                                      #33

                                      @douglas like you did the other modules

                                      git clone git://code.qt.io/qt/<qt-module>.git -b <qt-version>
                                      cd <qt-module>
                                      
                                      qmake
                                      make
                                      make install
                                      

                                      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.

                                      Pablo J. RoginaP 1 Reply Last reply
                                      1
                                      • J.HilkJ J.Hilk

                                        @douglas like you did the other modules

                                        git clone git://code.qt.io/qt/<qt-module>.git -b <qt-version>
                                        cd <qt-module>
                                        
                                        qmake
                                        make
                                        make install
                                        
                                        Pablo J. RoginaP Offline
                                        Pablo J. RoginaP Offline
                                        Pablo J. Rogina
                                        wrote on last edited by
                                        #34

                                        @douglas if you could please show us

                                        How did you cross-compile for your target device?

                                        It may help understanding your issue

                                        Upvote the answer(s) that helped you solve the issue
                                        Use "Topic Tools" button to mark your post as Solved
                                        Add screenshots via postimage.org
                                        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

                                        douglasD 1 Reply Last reply
                                        1
                                        • Pablo J. RoginaP Pablo J. Rogina

                                          @douglas if you could please show us

                                          How did you cross-compile for your target device?

                                          It may help understanding your issue

                                          douglasD Offline
                                          douglasD Offline
                                          douglas
                                          wrote on last edited by
                                          #35

                                          @Pablo-J.-Rogina , after the Qt Creator installation, I followed the indication from 2.1 to 2.7 chapter here:
                                          http://variwiki.com/index.php?title=Yocto_Qt_Creator&release=RELEASE_MORTY_V1.0_DART-6UL#QtCreator_configuration
                                          in which, as far as I see, the environment is configured to cross-compile for my target device.
                                          Now, I am able to create a simple GUI application and run it on my target device, but I can't add the serialport component (in order to manage a RS485 communication) in my project.
                                          Unfortunatelly, I'm a beginner in this matter!
                                          Thanks a lot!

                                          Pablo J. RoginaP 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