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
QtWS25 Last Chance

Problems when adding serialport module in Qt project

Scheduled Pinned Locked Moved Solved General and Desktop
serialportqserialport
58 Posts 7 Posters 31.0k 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.
  • D douglas
    18 Jun 2018, 11:59

    @jsulm Yes, I did. I always obtain the

    fatal error: qdeadlinetimer.h: File o directory non esistente
    compilation terminated.
    
    A Offline
    A Offline
    aha_1980
    Lifetime Qt Champion
    wrote on 18 Jun 2018, 12:10 last edited by
    #49

    @douglas please send the output of git status

    Qt has to stay free or it will die.

    D 1 Reply Last reply 18 Jun 2018, 13:17
    0
    • A aha_1980
      18 Jun 2018, 12:10

      @douglas please send the output of git status

      D Offline
      D Offline
      douglas
      wrote on 18 Jun 2018, 13:17 last edited by
      #50

      @aha_1980

      Sul branch v5.7.1
      Untracked files:
        (use "git add <file>..." to include in what will be committed)
      
      	./
      
      nothing added to commit but untracked files present (use "git add" to track)
      

      Am I missing something?

      A 1 Reply Last reply 18 Jun 2018, 14:17
      0
      • D douglas
        18 Jun 2018, 13:17

        @aha_1980

        Sul branch v5.7.1
        Untracked files:
          (use "git add <file>..." to include in what will be committed)
        
        	./
        
        nothing added to commit but untracked files present (use "git add" to track)
        

        Am I missing something?

        A Offline
        A Offline
        aha_1980
        Lifetime Qt Champion
        wrote on 18 Jun 2018, 14:17 last edited by
        #51

        @douglas Looks good so far.

        But let's move slowly. I re-read you post from 5 hours ago:

        @aha_1980 Thanks. In Qt Creator I set Qt 5.7.1 in the "Qt Version" for the selected kit for my project. Now I can add the serialport module in my .pro file and build the app

        If you can build the app, then you already have the serialport module!

        but when I try to run it on my target device, the application does not start and the following error appears:

        But you don't have the libraries on your target device.

        Qt has to stay free or it will die.

        D 1 Reply Last reply 18 Jun 2018, 14:26
        0
        • A aha_1980
          18 Jun 2018, 14:17

          @douglas Looks good so far.

          But let's move slowly. I re-read you post from 5 hours ago:

          @aha_1980 Thanks. In Qt Creator I set Qt 5.7.1 in the "Qt Version" for the selected kit for my project. Now I can add the serialport module in my .pro file and build the app

          If you can build the app, then you already have the serialport module!

          but when I try to run it on my target device, the application does not start and the following error appears:

          But you don't have the libraries on your target device.

          D Offline
          D Offline
          douglas
          wrote on 18 Jun 2018, 14:26 last edited by
          #52

          @aha_1980 Thanks, I understand. In order to obtain those libraries on my target device is something that I should copy from my host PC onto the device itself or I should install directly on the device side in any way?

          A P 2 Replies Last reply 18 Jun 2018, 14:29
          0
          • D douglas
            18 Jun 2018, 14:26

            @aha_1980 Thanks, I understand. In order to obtain those libraries on my target device is something that I should copy from my host PC onto the device itself or I should install directly on the device side in any way?

            A Offline
            A Offline
            aha_1980
            Lifetime Qt Champion
            wrote on 18 Jun 2018, 14:29 last edited by
            #53

            @douglas In the most easy and hacky way, just copy the needed *.so files to the other Qt *.so files on your device.

            Depending on your cross toolchain, there may be a more clean way (like building a new image), but that - as said - depends on you toolchain.

            Qt has to stay free or it will die.

            1 Reply Last reply
            1
            • D douglas
              18 Jun 2018, 14:26

              @aha_1980 Thanks, I understand. In order to obtain those libraries on my target device is something that I should copy from my host PC onto the device itself or I should install directly on the device side in any way?

              P Offline
              P Offline
              Pablo J. Rogina
              wrote on 18 Jun 2018, 14:34 last edited by
              #54

              @douglas as @aha_1980 said, maybe easiest way is to copy the serialport module *.so the same way you're deploying the file(s) for your application. Perhaps at the beginning it's easy to copy the shared library into same folder as application's executable

              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

              D 1 Reply Last reply 18 Jun 2018, 14:47
              0
              • P Pablo J. Rogina
                18 Jun 2018, 14:34

                @douglas as @aha_1980 said, maybe easiest way is to copy the serialport module *.so the same way you're deploying the file(s) for your application. Perhaps at the beginning it's easy to copy the shared library into same folder as application's executable

                D Offline
                D Offline
                douglas
                wrote on 18 Jun 2018, 14:47 last edited by
                #55

                @Pablo-J.-Rogina , @aha_1980 thank you. I expected to find the libQt5SerialPort.so.5 (the missing library) inside the qtserialport folder generated after the steps:

                $ git clone git://code.qt.io/qt/qtserialport.git
                $ mkdir qtserialport-build
                $ cd qtserialport-build
                $ qmake ../qtserialport/qtserialport.pro
                

                but I couldn't find it. I searched into my host PC for that file, I found few results, but they are located into the Qt installation folder, they are not cross-compiled for my needs, I think.
                When exactly that library should be created, or where it should be located?
                Thanks!

                J 1 Reply Last reply 19 Jun 2018, 04:35
                0
                • D douglas
                  18 Jun 2018, 14:47

                  @Pablo-J.-Rogina , @aha_1980 thank you. I expected to find the libQt5SerialPort.so.5 (the missing library) inside the qtserialport folder generated after the steps:

                  $ git clone git://code.qt.io/qt/qtserialport.git
                  $ mkdir qtserialport-build
                  $ cd qtserialport-build
                  $ qmake ../qtserialport/qtserialport.pro
                  

                  but I couldn't find it. I searched into my host PC for that file, I found few results, but they are located into the Qt installation folder, they are not cross-compiled for my needs, I think.
                  When exactly that library should be created, or where it should be located?
                  Thanks!

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 19 Jun 2018, 04:35 last edited by
                  #56

                  @douglas Are you sure you're cross compiling your app?
                  If so just do

                  ldd YOUR_APP_EXE
                  

                  it will show you which libs it is linked against, you then will know where the serial port lib is.

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

                  D 1 Reply Last reply 19 Jun 2018, 06:15
                  1
                  • J jsulm
                    19 Jun 2018, 04:35

                    @douglas Are you sure you're cross compiling your app?
                    If so just do

                    ldd YOUR_APP_EXE
                    

                    it will show you which libs it is linked against, you then will know where the serial port lib is.

                    D Offline
                    D Offline
                    douglas
                    wrote on 19 Jun 2018, 06:15 last edited by
                    #57

                    @jsulm the ldd command does not give any result; it gives a message saying it is "not a dynamic exacutable"..

                    1 Reply Last reply
                    0
                    • D Offline
                      D Offline
                      douglas
                      wrote on 19 Jun 2018, 13:50 last edited by
                      #58

                      Solved. The missing libQt5SerialPort.so.5 error on the target device was because that library effectively was not present. On the host side I added that library in the package list of the image and rebuild the image itself.

                      1 Reply Last reply
                      0

                      58/58

                      19 Jun 2018, 13:50

                      • Login

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