Results 1 to 12 of 12

Thread: Serial communication program in QT

  1. #1
    Join Date
    Mar 2011
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Serial communication program in QT

    Hello frnz,

    am new to QT and am supposed to build an application in linux QT for serial communication. As Trolltech has not provided any class to facilitate serial communication, I have downloaded "qextserialport-1.1.tar.gz" from http://qextserialport.sourceforge.net.

    Now I want to know the procedure to compile in linux qt and make use of the classes just similar to other classes of QT.

    Please help me
    Thank u

  2. #2
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Serial communication program in QT

    QextSerialPort must be compiled using qmake

    Qt Code:
    1. qmake qextserialport.pro
    2. make
    To copy to clipboard, switch view to plain text mode 
    A camel can go 14 days without drink,
    I can't!!!

  3. #3
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Thumbs up Re: Serial communication program in QT

    hi,
    if u hav a pro file in the source, just compile as normal qt program.
    u need to create the lib from the downloaded source. and then link this lib in ur application.

    hope it helps
    Bala

  4. #4
    Join Date
    Mar 2011
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Qextserialport classes are dowloaded, Pls tell me the procedure to access classes.

    Hii

    Im working in QT 4, with linux and developing serial communication prog in QT. So i down loaded "qextserialport-1.1.tar.gz" from http://qextserialport.sourceforge.net

    Please dictate me the procedure to install it in QT of linux, So that I can access those classes as same as other classes of QT.

    Thank u

  5. #5
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Qextserialport classes are dowloaded, Pls tell me the procedure to access classes

    please don't post in multiple Forum http://www.qtcentre.org/threads/3989...-program-in-QT
    A camel can go 14 days without drink,
    I can't!!!

  6. #6
    Join Date
    Jan 2011
    Posts
    6
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Qextserialport classes are dowloaded, Pls tell me the procedure to access classes

    Hi,

    there has been a similar thread recently, see http://www.qtcentre.org/threads/3940...873#post180873

    In any case, if you need to use the qextserialport library, you should use the code from http://code.google.com/p/qextserialport. There are some examples in the "examples" directory.

    Thanks,
    Andreas

  7. #7
    Join Date
    Jan 2009
    Location
    Russia
    Posts
    309
    Thanks
    2
    Thanked 43 Times in 42 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Serial communication program in QT

    2 pupqt,

    If you're new and are not afraid of the GPL license, use QSerialDevice: http://gitorious.org/qserialdevice/q...e/trees/master
    Direct download: http://gitorious.org/qserialdevice/q...tarball/master

    This library is better than QExtSerialPort.
    It has good documentation, many examples, it is simple and is developing at the current time (Unlike other libraries).

    PS: Although use any library that you like.

  8. The following user says thank you to kuzulis for this useful post:

    bob2oneil (19th April 2011)

  9. #8
    Join Date
    Mar 2011
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Serial communication program in QT

    Quote Originally Posted by BalaQT View Post
    hi,
    if u hav a pro file in the source, just compile as normal qt program.
    u need to create the lib from the downloaded source. and then link this lib in ur application.

    hope it helps
    Bala

    Hii,

    I tried the method u explained, I came with some errors so I think clarification is required.

    The downloaded source is "qextserialport-1.1.tar.gz" from "http://qextserialport.sourceforge.net/qextserialport-1.0.x/" website.

    I followed the following steps:
    1. Extracted archive
    2. I got qextserialport folder containing these files:
    examples
    Doxyfile
    html
    Doc
    CHANGES
    posix_qextserialport.cpp
    posix_qextserialport.h
    qextserialport.pro
    qextserialport.cpp
    win_qextserialport.cpp
    win_qextserialport.h
    qextserialbase.cpp
    qextserialbase.h

    3. Copied this qextserialport folder in the src folder of QT software running in linux.
    4. gave command qmake qextserialport.pro
    5. Then gave command make

    then list of errors came saying:

    [root@w2kserver qextserialport]# qmake qextserialport.pro


    [root@w2kserver qextserialport]# make


    g++ -c -pipe -Wall -W -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_REENTRANT -fPIC -D_TTY_POSIX_ -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt-3.3/mkspecs/default -I. -I/usr/lib/qt-3.3/include -Ibuild/moc/ -o build/obj/qextserialbase.o
    qextserialbase.cpp
    In file included from qextserialbase.cpp:2:


    qextserialbase.h:5:21: error: QIODevice: No such file or directory
    qextserialbase.h:6:17: error: QFile: No such file or directory
    qextserialbase.h:9:19: error: QThread: No such file or directory
    qextserialbase.h:10:18: error: QMutex: No such file or directory
    qextserialbase.h:137: error: ‘ulong’ does not name a type

    qextserialbase.h:138: error: ‘ulong’ does not name a type

    qextserialbase.h:141: error: expected class-name before ‘{’ token
    qextserialbase.h:144: error: expected ‘,’ or ‘...’ before ‘&’ token

    qextserialbase.h:144: error: ISO C++ forbids declaration of ‘QString’ with no type
    qextserialbase.h:147: error: expected ‘,’ or ‘...’ before ‘&’ token


    Have I followed the correct method. Before giving qmake command, *.pro file needs to be configured??????

  10. #9
    Join Date
    Aug 2009
    Location
    Belgium
    Posts
    310
    Thanks
    10
    Thanked 31 Times in 25 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Serial communication program in QT

    Do you have QtCreator on your system ?
    If so, create a simple 'hello world' application and try to run and compile that. If this is OK, then your Qt installation is (probably) OK.
    Then, open the qextserialport.pro file using Qt Creator and do a 'build all'

    By the way, you didn't put the qextserialport source under the src directory of Qt itself did you ? You should put things like this in your own personal folder where you keep your Qt projects.

    Regards,
    Marc

  11. #10
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Serial communication program in QT

    g++ -c -pipe -Wall -W -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_REENTRANT -fPIC -D_TTY_POSIX_ -DQT_NO_DEBUG -DQT_THREAD_SUPPORT -DQT_SHARED -I/usr/lib/qt-3.3/mkspecs/default -I. -I/usr/lib/qt-3.3/include -Ibuild/moc/ -o build/obj/qextserialbase.o
    qextserialbase.cpp
    In file included from qextserialbase.cpp:2:


    qextserialbase.h:5:21: error: QIODevice: No such file or directory
    You don't have Qt4 installed.
    You need Qt4.
    Install Qt4 first.
    Or get a previous version of QextSerialPort which is based on Qt3.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  12. #11
    Join Date
    Oct 2009
    Posts
    364
    Thanks
    10
    Thanked 37 Times in 36 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Serial communication program in QT

    Quote Originally Posted by pupqt View Post
    The downloaded source is "qextserialport-1.1.tar.gz" from "http://qextserialport.sourceforge.net/qextserialport-1.0.x/" website.
    qextserialport is no longer hosted on sourceforge - please go to http://code.google.com/p/qextserialport like littletux suggested. Plus, you should follow the suggestion by high_flyer and install Qt4 (if possible).

    qextserialport has been discussed many times in this forum. It is a library and it comes with examples. If you study and understand how the examples use the library then you are well on your way.

  13. #12
    Join Date
    Mar 2011
    Posts
    15
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Serial communication program in QT

    Quote Originally Posted by marcvanriet View Post
    Do you have QtCreator on your system ?
    If so, create a simple 'hello world' application and try to run and compile that. If this is OK, then your Qt installation is (probably) OK.
    Then, open the qextserialport.pro file using Qt Creator and do a 'build all'

    By the way, you didn't put the qextserialport source under the src directory of Qt itself did you ? You should put things like this in your own personal folder where you keep your Qt projects.

    Regards,
    Marc



    Hi Marc,

    great!!! I cud get .so files
    Now i will copy those files to usr/lib folder to access qextserial port as global class.

    anything else i need to be consider before doing so?? I mean to tell setting path or changing .pro file?

Similar Threads

  1. serial communication
    By klitsuk in forum Qt Programming
    Replies: 10
    Last Post: 24th September 2009, 01:21
  2. serial communication
    By klitsuk in forum Qt Programming
    Replies: 1
    Last Post: 10th March 2009, 15:22
  3. serial communication
    By semden in forum Qt Programming
    Replies: 2
    Last Post: 13th February 2009, 09:57
  4. serial communication programming
    By jagadish in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2007, 07:47
  5. Serial Port Communication
    By soldstatic in forum Qt Programming
    Replies: 6
    Last Post: 22nd June 2006, 16:05

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.