Results 1 to 6 of 6

Thread: QextSerialPort

  1. #1
    Join Date
    Jun 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QextSerialPort

    I'm trying to do a program which sends information to serial port. I have a problem using QextSerialPort class. I don't understand how to add it to my current project. Just add headers and cpp-files or do I have to build it? I'm currently using this how-to with my projects and it seems to work but I have no idea how to make it work with QextSerialPort.

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QextSerialPort

    Take a look at project files of QextSerialPort examples. They include a shared .pri file which contains all the "magic":
    Qt Code:
    1. LIBS += ...
    2. INCLUDEPATH += ...
    To copy to clipboard, switch view to plain text mode 
    You need to link the lib and pass suitable paths for the compiler to find headers.
    J-P Nurmi

  3. #3
    Join Date
    Jun 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QextSerialPort

    Sorry I don't quite understand. Do you mean that there should be QextSerialPort lib-file and I should link it with my project?

    Ps. If you know good tutorials how to set Visual Studio properly I would appreciate it. Every site seems to do it differently and now I'm a bit confused how to proceed.

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QextSerialPort

    Quote Originally Posted by Diph View Post
    Sorry I don't quite understand. Do you mean that there should be QextSerialPort lib-file and I should link it with my project?
    Yes, QextSerialPort is a library. You should start with compiling it. Once you have done that, take a look at the examples. The examples are ordinary applications using the library. You should do it the same way.
    J-P Nurmi

  5. #5
    Join Date
    Jun 2008
    Posts
    24
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QextSerialPort

    Quote Originally Posted by jpn View Post
    Yes, QextSerialPort is a library. You should start with compiling it. Once you have done that, take a look at the examples. The examples are ordinary applications using the library. You should do it the same way.
    Now I have compiled it. I have libqextserialport.a and qextserialport.dll files in build directory. Do I have to put these files somewhere and how do I set Visual Studio project settings correctly. If I'm correct I don't have to use pro-file because of autoBuild program.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QextSerialPort

    Quote Originally Posted by Diph View Post
    Now I have compiled it. I have libqextserialport.a and qextserialport.dll files in build directory. Do I have to put these files somewhere and how do I set Visual Studio project settings correctly. If I'm correct I don't have to use pro-file because of autoBuild program.
    I have no idea what is an autoBuild program. Visual Studio has been officially supported by qmake since Qt 4.3.2. All I need to take care is to maintain the cross-platform project (.pro) file. Typing "qmake -tp vc" makes qmake to generate a Visual Studio project file for me. That's the way I maintain my projects in Windows. The huge benefit is that based on the .pro file qmake is also able to generate Makefiles for other compilers on various platforms. A Visual Studio project file is not much of use in Linux or Mac.

    So, if I would do it, I would simply fill in the necessary LIBS and INCLUDEPATH to the .pro and regenerate the .vcproj and voilà !
    J-P Nurmi

Similar Threads

  1. Modbus, QextSerialPort and QTimer
    By ^NyAw^ in forum General Programming
    Replies: 6
    Last Post: 27th October 2009, 16:14
  2. Problem in QExtserialport program.
    By dheeraj in forum Qt Programming
    Replies: 5
    Last Post: 31st May 2008, 10:24
  3. Replies: 4
    Last Post: 30th January 2008, 10:00
  4. any body using qextserialport?
    By yagabey in forum Newbie
    Replies: 4
    Last Post: 25th December 2007, 22:08
  5. QExtSerialPort with com ports above com9
    By mightymark in forum Qt Programming
    Replies: 2
    Last Post: 29th May 2006, 08:16

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.