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. SerialPortinfo::availableports()
Forum Updated to NodeBB v4.3 + New Features

SerialPortinfo::availableports()

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 3 Posters 890 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.
  • I Offline
    I Offline
    Imman_Manny
    wrote on last edited by
    #1

    SerialPortinfo :: availableports()

    Am trying to list the Available port in system (Cmake), it showing error like
    C:......\main.cpp:16: error: undefined reference to `__imp__ZN15QSerialPortInfo14availablePortsEv'

    c98b94bb-4b6d-4d2d-8c2c-4e10541f5afb-image.png

    kindly Help to resolve this.

    JonBJ 1 Reply Last reply
    0
    • I Imman_Manny

      SerialPortinfo :: availableports()

      Am trying to list the Available port in system (Cmake), it showing error like
      C:......\main.cpp:16: error: undefined reference to `__imp__ZN15QSerialPortInfo14availablePortsEv'

      c98b94bb-4b6d-4d2d-8c2c-4e10541f5afb-image.png

      kindly Help to resolve this.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #2

      @Imman_Manny
      I don't use cmake, but have you done the target_link_libraries(mytarget PRIVATE Qt6::SerialPort) thing?

      I 2 Replies Last reply
      1
      • JonBJ JonB

        @Imman_Manny
        I don't use cmake, but have you done the target_link_libraries(mytarget PRIVATE Qt6::SerialPort) thing?

        I Offline
        I Offline
        Imman_Manny
        wrote on last edited by
        #3

        @JonB

        Thank you for your Reply
        yes, i did included Qt::6 serialport & serial Bus
        Am a beginner kind help . Patiently

        1 Reply Last reply
        0
        • JonBJ JonB

          @Imman_Manny
          I don't use cmake, but have you done the target_link_libraries(mytarget PRIVATE Qt6::SerialPort) thing?

          I Offline
          I Offline
          Imman_Manny
          wrote on last edited by
          #4

          @JonB
          Thankyou so jonB , Am also tried the Qmake its worked Sucessfully .

          JonBJ 1 Reply Last reply
          0
          • I Imman_Manny

            @JonB
            Thankyou so jonB , Am also tried the Qmake its worked Sucessfully .

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @Imman_Manny
            Are you using Qt6 or Qt5?

            I 1 Reply Last reply
            0
            • JonBJ JonB

              @Imman_Manny
              Are you using Qt6 or Qt5?

              I Offline
              I Offline
              Imman_Manny
              wrote on last edited by
              #6

              @JonB QT6

              JonBJ 1 Reply Last reply
              0
              • I Imman_Manny

                @JonB QT6

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote on last edited by
                #7

                @Imman_Manny
                Qt6 itself has moved over to cmake (if you want to build it, access its internals etc.). You can still use qmake with it for your own projects. However the experts may recommend you change over to cmake yourself now. So you might want to revisit why yours does not work with cmake and sort it out. Perhaps someone else will comment.

                1 Reply Last reply
                0
                • C Offline
                  C Offline
                  ChrisW67
                  wrote on last edited by
                  #8

                  You would need both these in a CMakeLists.txt:

                  find_package(Qt6 REQUIRED COMPONENTS SerialPort)
                  target_link_libraries(mytarget PRIVATE Qt6::SerialPort)
                  

                  and you would have had to install the "Qt Serial Port" option under additional libraries for the Qt version (6.4.1?) you are building against.

                  I 1 Reply Last reply
                  1
                  • C ChrisW67

                    You would need both these in a CMakeLists.txt:

                    find_package(Qt6 REQUIRED COMPONENTS SerialPort)
                    target_link_libraries(mytarget PRIVATE Qt6::SerialPort)
                    

                    and you would have had to install the "Qt Serial Port" option under additional libraries for the Qt version (6.4.1?) you are building against.

                    I Offline
                    I Offline
                    Imman_Manny
                    wrote on last edited by
                    #9

                    @ChrisW67 Thank you chris

                    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