Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Serial Ports in Qt 4.7
QtWS25 Last Chance

Serial Ports in Qt 4.7

Scheduled Pinned Locked Moved Installation and Deployment
11 Posts 4 Posters 15.9k 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.
  • V Offline
    V Offline
    vezprog
    wrote on last edited by
    #1

    In the newest version of Qt, is there support for serial ports? (cross platform)

    I am developing in Linux but would like a cross platform way to create a serial port connection between windows and linux.

    ttyS0 and COM1

    Thanks in advance!

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koahnig
      wrote on last edited by
      #2

      the serial port is not directly supported by Qt. However, there is a project "qextserialport":http://code.google.com/p/qextserialport/ which shall help you in your task. There are also a couple of posts in this forum concerning the topic.
      Go to "tags":http://developer.qt.nokia.com/tags on this webpage and type qextserialport.

      Vote the answer(s) that helped you to solve your issue(s)

      1 Reply Last reply
      0
      • V Offline
        V Offline
        vezprog
        wrote on last edited by
        #3

        hm, I have looked at the qextserialport library before. I just cant figure out how to first:

        • Download the library
        • There is no tutorial on how to implement the library in the code

        to bad qt doesn't have it built in :/

        Edit: I just got it downloaded, now I am looking at the examples to see if I can get it working. Thank you very much for the help again.

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vezprog
          wrote on last edited by
          #4

          Sorry for the double post. I am having trouble figuring out how add the library to my project.

          I downloaded the source files from the svn. There doesnt seem to be a library file incorperated with the download.

          Do you know of any tutorial on how to implement qextserialport into a project? or have you done it before?

          the enumorator example that came with the download is perfect for what I need, I am just not sure how to get it to work...

          Thanks

          1 Reply Last reply
          0
          • K Offline
            K Offline
            koahnig
            wrote on last edited by
            #5

            The library you have create yourself. Or you just link the objects directly to your application.
            I have used the lib (correction: I have used the code, but I did not bother to make a lib out of it), but I downloaded from Sourceforge sometime ago. It has been moved to google later.
            Were you able to compile the examples?

            Vote the answer(s) that helped you to solve your issue(s)

            1 Reply Last reply
            0
            • V Offline
              V Offline
              vezprog
              wrote on last edited by
              #6

              I opened the src.pro in the main folder and compiled it, which created the lib files.

              Now I try to open the examples and they don't run, it still says cannot find librarys.

              Can I copy the librarys into a desired folder location within my new project, then just link the library's?
              That would require editing to the .pro file of my own project correct...?

              1 Reply Last reply
              0
              • K Offline
                K Offline
                koahnig
                wrote on last edited by
                #7

                I have just checked the download I have. First, one correction I did compile as a lib, then I could compile and run the examples. However, I was not succeeding with one of the examples, unfortunately the enumerator example.
                Did you try to compile the other examples?

                BTW: I have used it on windows with vs2005.

                Vote the answer(s) that helped you to solve your issue(s)

                1 Reply Last reply
                0
                • EddyE Offline
                  EddyE Offline
                  Eddy
                  wrote on last edited by
                  #8

                  Moved to the installation subforum

                  Qt Certified Specialist
                  www.edalsolutions.be

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    vezprog
                    wrote on last edited by
                    #9

                    I built the qextserialport.pro file in the main folder in the Qtdesigner. I see the examples on the left. Alls I want to do is just use the serial port functionality in my application. What would be the easiest why to do this?

                    I havent started building my app yet. I have a blank project right now, but I would like to get the serial communication going first before I do anything.

                    1 Reply Last reply
                    0
                    • V Offline
                      V Offline
                      vezprog
                      wrote on last edited by
                      #10

                      Also, I keep getting linking errors even when I try to run the examples...

                      /home/../../qextserialport-build-desktop-Desktop_Qt_4_7_3_for_GCC__Qt_SDK__Release/examples/event/event: error while loading shared libraries: libqextserialport.so.1: cannot open shared object file: No such file or directory

                      1 Reply Last reply
                      0
                      • U Offline
                        U Offline
                        uranusjr
                        wrote on last edited by
                        #11

                        Qt Creator uses shadow building, and builds the lib files in another directory instead of the same directory of the source codes. Therefore, the .pro file for the QextSerialPort example fails to find the correct path. You have several ways to correct this:

                        1. Change the QMAKE_LIB variable in the .pro file of the example to point to the directory that contains the .so files

                        2. Turn off shadow building in both the library and the example, or use the console to build them.

                        3. Copy the .so files to your Qt installation's lib path.

                        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