Qt5: Unknown module(s) in QT: serialport



  • Hi,
    Qt5/Qt Creator 2.6.1/linux64/ubuntu 12.10/:
    I installed QtSerialPort.
    QT += serialport in .pro
    Runing the terminal example I get:
    @17:49:40: Running steps for project terminal...
    17:49:40: Starting: "/home/wim/Qt5.0.0/5.0.0/gcc_64/bin/qmake" /home/wim/qt/terminal/terminal.pro -r -spec linux-g++-64 CONFIG+=debug CONFIG+=declarative_debug CONFIG+=qml_debug
    Project ERROR: Unknown module(s) in QT: serialport
    17:49:40: The process "/home/wim/Qt5.0.0/5.0.0/gcc_64/bin/qmake" exited with code 3.
    Error while building/deploying project terminal (kit: Desktop Qt 5.0.0 GCC 64bit (SDK))
    When executing step 'qmake'@

    Qt version for desktop:

    @Name:
    Qt 5.0.0 GCC 64bit (SDK)
    ABI:
    x86-linux-generic-elf-64bit
    Source:
    /home/wim/Qt5.0.0/5.0.0/gcc_64
    mkspec:
    linux-g++-64
    qmake:
    /home/wim/Qt5.0.0/5.0.0/gcc_64/bin/qmake
    Version:
    5.0.0
    QMAKE_SPEC
    linux-g++-64
    QMAKE_VERSION
    3.0
    QMAKE_XSPEC
    linux-g++-64
    QT_HOST_BINS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/bin
    QT_HOST_DATA
    /home/wim/Qt5.0.0/5.0.0/gcc_64
    QT_HOST_PREFIX
    /home/wim/Qt5.0.0/5.0.0/gcc_64
    QT_INSTALL_ARCHDATA
    /home/wim/Qt5.0.0/5.0.0/gcc_64
    QT_INSTALL_BINS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/bin
    QT_INSTALL_CONFIGURATION
    /etc/xdg
    QT_INSTALL_DATA
    /home/wim/Qt5.0.0/5.0.0/gcc_64/
    QT_INSTALL_DEMOS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/examples
    QT_INSTALL_DOCS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/doc
    QT_INSTALL_EXAMPLES
    /home/wim/Qt5.0.0/5.0.0/gcc_64/examples
    QT_INSTALL_HEADERS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/include
    QT_INSTALL_IMPORTS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/imports
    QT_INSTALL_LIBEXECS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/libexec
    QT_INSTALL_LIBS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/lib
    QT_INSTALL_PLUGINS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/plugins
    QT_INSTALL_PREFIX
    /home/wim/Qt5.0.0/5.0.0/gcc_64
    QT_INSTALL_QML
    /home/wim/Qt5.0.0/5.0.0/gcc_64/qml
    QT_INSTALL_TESTS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/tests
    QT_INSTALL_TRANSLATIONS
    /home/wim/Qt5.0.0/5.0.0/gcc_64/translations
    QT_SYSROOT

    QT_VERSION
    5.0.0
    @

    So, qmake looks for libs and header files locally (/home/wim/Qt5.0.0/5.0.0/gcc_64). So I copied the serial libs and headers to this local directory as well.
    Still the serial module cannot be found...



  • Well, answering myself...
    After some experimenting I found out that I had to copy the include, libs and mkspecs directories from the qtserialport build directory into the current project directory.
    (BTW: check the permissions of the ttyXXX you like to connect to).



  • 我也遇上来 纠结来半天才发现是在原来有2个qmake 貌似编译qtserialport时用那个qt5.0.0里面的qmake就正常了
    /home/han/Qt5.0.0/5.0.0/gcc/bin/qmake -spec /home/han/Qt5.0.0/5.0.0/gcc/mkspecs/linux-g++-32 ../qtserialport/qtserialport.pro



  • wspilot, you saved my time.
    Had the same issues with Qt3D. The point about copying mkspecs also was critical.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.