Results 1 to 5 of 5

Thread: error: Unknown module(s) in QT: serialport

  1. #1
    Join Date
    Jan 2013
    Posts
    43
    Thanks
    27
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default error: Unknown module(s) in QT: serialport

    Hi

    I'm trying to build the example on this wiki: http://qt-project.org/wiki/QtSerialPort
    I'm using Qt5 and Debian Wheezy.

    After building and installing the libraries (i think), when i try to build the application e get:
    error: Unknown module(s) in QT: serialport

    My .pro is like this.
    Qt Code:
    1. #-------------------------------------------------
    2. #
    3. # Project created by QtCreator 2013-03-09T10:12:11
    4. #
    5. #-------------------------------------------------QT += serialport
    6. QT += serialport
    7. QT += core
    8. QT -= gui
    9.  
    10. TARGET = serial01
    11. CONFIG += console
    12. CONFIG -= app_bundle
    13.  
    14. TEMPLATE = app
    15.  
    16.  
    17. SOURCES += main.cpp
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include <QCoreApplication>
    2. #include <QDebug>
    3.  
    4. #include <QtSerialPort/qserialport.h>
    5. #include <QtSerialPort/qserialportinfo.h>
    6.  
    7. QT_USE_NAMESPACE_SERIALPORT
    8.  
    9. int main(int argc, char *argv[])
    10. {
    11. QCoreApplication a(argc, argv);
    12.  
    13. // Example use SerialPortInfo
    14. foreach (const SerialPortInfo &info, SerialPortInfo::availablePorts()) {
    15. qDebug() << "Name : " << info.portName();
    16. qDebug() << "Description : " << info.description();
    17. qDebug() << "Manufacturer: " << info.manufacturer();
    18.  
    19. // Example use SerialPort
    20. SerialPort serial;
    21. serial.setPort(info);
    22. if (serial.open(QIODevice::ReadWrite))
    23. serial.close();
    24. }
    25.  
    26. return a.exec();
    27. }
    To copy to clipboard, switch view to plain text mode 

    There also seeams to be a problem with the QT_USE_NAMESPACE_SERIALPORT

    What is missing here?

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error: Unknown module(s) in QT: serialport

    How did you install the library?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Jan 2013
    Posts
    43
    Thanks
    27
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: error: Unknown module(s) in QT: serialport

    #1 - downloaded the code from http://qt.gitorious.org/qt/qtserialp...tarball/master

    #2 - uncompressed it to ~/Downloads/qt-qtserialport

    #3 - created a buil location ~/Downloads/qt-qtserialportbuild$

    #4 - In #3 folder executed
    qmake ../qt-qtserialport/qtserialport.pro
    make
    su -c "make install"

    Looking better ...there seems to be no .so library! Where showld it be?


    Added after 7 minutes:


    And i have:
    Qt Code:
    1. $ ls -l /usr/include/Q*
    2. total 28
    3. -rw-r--r-- 1 root root 25 Mar 9 10:09 QSerialPort
    4. -rw-r--r-- 1 root root 2392 Mar 2 17:47 qserialportglobal.h
    5. -rw-r--r-- 1 root root 8438 Mar 2 17:47 qserialport.h
    6. -rw-r--r-- 1 root root 29 Mar 9 10:09 QSerialPortInfo
    7. -rw-r--r-- 1 root root 3266 Mar 2 17:47 qserialportinfo.h
    To copy to clipboard, switch view to plain text mode 
    Last edited by aguleo; 9th March 2013 at 16:47.

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,012 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: error: Unknown module(s) in QT: serialport

    From what I see it should be in the same directory as your Qt libraries.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. The following user says thank you to wysota for this useful post:

    aguleo (11th March 2013)

  6. #5
    Join Date
    Jan 2013
    Posts
    43
    Thanks
    27
    Thanked 6 Times in 5 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: error: Unknown module(s) in QT: serialport

    The examples in the "example" folder build correctly, and i was able to do basic serial communication.
    The errors i mentioned above must be related to Qt version!

Similar Threads

  1. QHostInfo - Unknown Error
    By alurchi in forum Qt Programming
    Replies: 7
    Last Post: 17th May 2011, 11:59
  2. QNetworkAccessManager unknown error
    By lipk in forum Newbie
    Replies: 2
    Last Post: 20th March 2011, 13:38
  3. QSslsocket and Unknown error
    By szarek in forum Qt Programming
    Replies: 21
    Last Post: 14th October 2010, 14:20
  4. unknown error reading svg file
    By RickF in forum Qt Programming
    Replies: 2
    Last Post: 8th August 2010, 02:12
  5. QimageReader Unknown Error
    By bhaskar in forum Newbie
    Replies: 1
    Last Post: 2nd June 2010, 08:24

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.