Project error unknown module s in qt serialport

Hi, I need to use QSerialport in my Qt project. Following the official documentation, I added QT += serialport to my .pro file. After doing this, the build always fails, giving the error: "Unknown module(s) in QT: serialport". I am using Qt Creator...

Forum Updated on Feb 6th

This topic has been deleted. Only users with topic management privileges can see it.

  • Hi,
    I need to use QSerialport in my Qt project. Following the official documentation, I added

    QT       += serialport
    

    to my .pro file. After doing this, the build always fails, giving the error: «Unknown module(s) in QT: serialport». I am using Qt Creator 4.1.0 based on Qt 5.6.1. What am I missing?
    Thank you.

  • Hi @douglas

    2 Questions:

    • did you rerun qmake after changing your .pro file?
    • for what OS are you trying to make the program? serialport is not available for all platforms
  • Hi,
    when I run qmake (Build menu -> Run qmake), I get the same error. I am trying to build an application for a device running Linux Yocto, and my host PC, in which Qt Creator is installed, has Uuntu 16.04 as O.S.
    My .pro file first lines looks like the following:

    QT       += core gui printsupport
    QT       += serialport
    

    Thank you!

  • @douglas

    • Which Qt version do you intend use?
    • How did you install Qt? If you installed with apt, you may add the serialport module explicitely.
  • @aha_1980 I am using Qt 5.6.1. I installed Qt creator with apt. What do you mean with «add serialport explicitely»?
    Thank you!

  • Hi,

    What @aha_1980 asked was whether you also installed the Qt5 SerialPort package using apt.

  • @douglas
    @aha_1980 told you need to install the packages individualy.

    sudo apt-get install libqt5serialport5
    sudo apt-get install libqt5serialport5-dev
    
  • @KillerSmath I installed those packages via Software Center. Perhaps have I to uninstall them and re-install via apt-get?
    Could it be the reason for the «unknown module» error?

  • Silly question: are you sure you are using Qt 5 and not Qt 4 for your project ?

  • @SGaist Yes, the Help menu from Qt Creator reports:
    0_1528877526983_c9026808-fe20-4a8b-99f4-31be90b3f4e8-immagine.png
    In fact, I read that serialport module was not included in Qt4, but it seems I am using Qt5, this is the reason why I can’t understand that build error..

  • That’s just the information about Qt Creator.

    You have to check the Kit you are using to build your application and which version of Qt it is using.

  • @douglas
    If nothing works, you can try to manage the packages from MaintenanceTool of QtCreator

      1. <Qt Folder>/MaintenanceTool
      1. Add or remove Components
      1. Expand your Qt version
      1. Expand Source Components
      1. Select the Qt Source Package
      1. Next, Install
  • @SGaist how can I make sure of the Qt version I am using in my project?

  • This post is deleted!

  • @douglas
    In QtCreator go to Tools -> Options -> build & run and check your kits

    0_1528878528527_b34127d9-9d4c-4f4e-896b-57a4a318f333-image.png

    In sidebar under the «Projects tab» you can select one of your installed kits:
    0_1528878587108_07154278-cd0d-49d8-b11f-48a5441b9854-image.png

  • @J.Hilk My environment is a bit different; I can’t find informations about the version..
    0_1528879450246_5ef95ff2-c072-4d13-894d-4b7af5bb41e7-immagine.png

  • @douglas
    from what one can see, it at least seems to be a version of Qt5, for more information press the «Manage kits» button

  • @J.Hilk The Manage Kit button shows the settings reported below, in which I can’t find any information regarding the Qt version in use:
    0_1528882243058_5fd714c7-c885-44b9-9911-43fbdc2ec394-immagine.png

    If from terminal I write

    $ qmake --version
    

    I obtain the following:

    qmake: could not exec '/usr/lib/x86_64-linux-gnu/qt4/bin/qmake': No such file or directory
    

    Is it relevant the «qt4» shown in that prompt?
    Thanks.

  • @douglas
    well, there we have your problem

    0_1528882573156_25bb3434-9c9d-43e1-91e3-d1d195bd5377-image.png

    you have no QtLibary selected to your kit. Se if you can actually select a QtVersion from that dropdown menu. If you can’t than you need to install an actual qt version.

    I would recommend the online installer from the Webside.

  • @J.Hilk Thanks, I added the version as shown below:
    0_1528884090398_f92cd759-ed4c-403b-9ff6-6b0378c19b45-immagine.png
    Now, since I should have Qt5, I added the serialport support in my .pro file, but the «unknow module» error still remains. I saw another thing that seems not so clear to me: I run Qt Creator from linux terminal, and when I open my project the terminal shows the following lines, marked in red, in which appears Qt4. Can this be related to the serialport module error?
    0_1528884382827_59039698-8cd0-49c5-8a93-a8c89abf87c9-immagine.png
    thank you again.

I try to install the plugin on a raspi3 with qt5. i use a conbee on usb0

No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 8.0 (jessie)
Release: 8.0
Codename: jessie

libqt5clucene5/oldstable,now 5.3.2-3 armhf [installed,automatic]
libqt5concurrent5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5core5a/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5dbus5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5designer5/oldstable,now 5.3.2-3 armhf [installed,automatic]
libqt5designercomponents5/oldstable,now 5.3.2-3 armhf [installed,automatic]
libqt5gui5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5help5/oldstable,now 5.3.2-3 armhf [installed,automatic]
libqt5network5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5opengl5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5opengl5-dev/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5printsupport5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5qml5/oldstable,now 5.3.2-4+rpi1+b1 armhf [installed,automatic]
libqt5quick5/oldstable,now 5.3.2-4+rpi1+b1 armhf [installed,automatic]
libqt5quickwidgets5/oldstable,now 5.3.2-4+rpi1+b1 armhf [installed,automatic]
libqt5serialport5/oldstable,now 5.3.2-2 armhf [installed,automatic]
libqt5sql5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5sql5-sqlite/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5svg5/oldstable,now 5.3.2-2 armhf [installed,automatic]
libqt5test5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5webkit5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5websockets5/oldstable,now 5.3.2-5 armhf [installed,automatic]
libqt5websockets5-dev/oldstable,now 5.3.2-5 armhf [installed]
libqt5widgets5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
libqt5xml5/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]
qt5-default/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed]
qt5-qmake/oldstable,now 5.3.2+dfsg-4+rpi1 armhf [installed,automatic]

Добрый день,
установила Qtcreator на debian jessie. При попытке запустить проект не находит QtCore/QCommandLineParser. Я нашла эту библиотечку в пакете qtbase5-dev, который у меня установлен. так же сам файл лежит в системе по пути
./usr/include/x86_64-linux-gnu/qt5/qtcore/qcommandLineParser. Как сделать так, чтобы qt ее увидел и проект запустился?

з.ы. хотела еще утонить можно ли в MC смотреть зависимости файлов?


Вы всё же покажите выхлоп консоли при запуске.

Русские дебианщики против цифрового слабоумия !


Мало видеть нам начало — надо видеть и конец. Если видишь ты создание — значит где-то есть ТВОРЕЦ
Многие жалуются: геометрия в жизни не пригодилась. Ямб от хорея им приходится отличать ежедневно?


Цитата: ferum от 03 марта 2017, 20:07:53
Вы всё же покажите выхлоп консоли при запуске.

из консоли в смысле Qmake собрать? или из консоли qtcreator запустить?
я из консоли устанавливаю qtcreator. Он устанавливается в папку /usr/bin/
при настройке проекта, автоматически видит qt 4.8.6 и 5.3.2, а вот qt, который я установила из установщика скачанного с сайта не видит. Но если ручками добавить qmake из /opt/Qt5.6.2/5.6/gcc_64/bin/qmake — то он отображается нормально. Но вот все-равно не работает. еще больше ошибочных библиотек показывает.
желтым подсвечивает все библиотеки типо
#include <QtCore/QCoreApplication>
#include <QtCore/QCommandLineParser>
#include <QtCore/QCommandLineOption>

и пишет Project ERROR: Unknown module(s) in QT: serialport. — это он не видит библиотечку QtSerialPort.

Цитата: alsoijw от 04 марта 2017, 15:26:44где?

Midnight Commander



Цитата: vic5710 от 06 марта 2017, 10:11:49если ставили ручками, то и переменные среды в креаторе добавляйте ручками
и в проекте INCLUDEPATH ,LIBS

подскажите пожалуйста, а где в креаторе добавлять ручками ?  я вот захожу инструменты -> параметры -> Сборка и запуск
Комплекты я поменяла — профиль Qt поставила на установленный 5.6.2 основные проблемы с зависимостями у меня пропали. А вот Gcc, отладчик и CMake в новой папке /opt/QT56.2 не нашла
Собирается проект нормально, только при запуске пишет, QPSQL driver not loaded. хотя в папке /opt/QT5.6.2/5.6/gcc_64/plugins/sqldrivers есть файл libqsqlpsql.so
может компилятор тоже тогда руками надо новый GCC прописать? только где его найти(

INCLUDEPATH ,LIBS прописывать в файле проекта .PRO? а пути писать к конкретным папкам писать или достаточно будет /opt/QT5.6.2


Cообщение объединено 06 марта 2017, 13:03:19


на винде проблема решалась просмотром зависимостей получившегося дебажного или релизного файла и копирования их всех в папочку с проектом. а тут я даже теряюсь чего и куда копировать(


Цитата: Екатерина от 06 марта 2017, 13:00:16Собирается проект нормально, только при запуске пишет, QPSQL driver not

это отдельный вопрос по плагину, лучше на prog.org.ru сходить
gcc  и прочее менять не надо ничего, если проект собирается и запускается, вы все сделали правильно.
для разных профилей Qt просто надо свои  /lib /include указывать
INCLUDEPATH, LIBS в .pro , если надо явно указать что-то. я например в креаторе на с++ пишу, я и добавляю в проект


CONFIG -= QT
INCLUDEPATH += /usr/lib/c++/include


Cообщение объединено 06 Марта 2017, 13:30:39


Цитата: Екатерина от 06 марта 2017, 13:00:16на винде проблема решалась просмотром зависимостей получившегося дебажного или релизного файла и копирования их всех в папочку с проектом. а тут я даже теряюсь чего и куда копировать(

ну это и на линухе можно в терминале


ldd my.exec.file


поняла. спасибо. попробую сходить еще туда.

у меня вот так

QT += core network serialport sql

QT -= gui

CONFIG += c++11

я кажется пока там лазала, что-то поменяла и теперь мне пишет ворнинг — GDB:Failed to set controlling terminal
но потом запускает приложеньку. это плохо?

и кстати как в линуксе можно проще всего зависимости файлов посмотреть? может все решится, как в винде? и я скину пару тысяч файликов в папку проекта и все заработает?


Цитата: Екатерина от 06 марта 2017, 13:36:32и я скину пару тысяч файликов в папку проекта и все заработает?

в линухе так не делают обычно, либы д.б. в /usr/lib /usr/local/lib и т.д.  хотя я так делал, чтобы с флешки запускать на разных компах.
надо писать в main.cpp

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    a.addLibraryPath(a.applicationDirPath());
    Widget w;
    w.resize(800,600);
    w.move(0,0);
    w.show();
    return a.exec();
}


Cообщение объединено 06 Марта 2017, 13:49:01


Цитата: Екатерина от 06 марта 2017, 13:36:32GDB:Failed to set controlling terminal
но потом запускает приложеньку. это плохо?

это вы дебаг где-то включили, не фатально, но лучше убрать.


Cообщение объединено 06 марта 2017, 13:50:57


кстати для postgresql вроде надо сам postgres установить/запустить, точно не знаю


Спасибо! не заметила про ldd.
Проверила свой дебажный файлик. он выдает зависимости и пути. значит ли это, что все хорошо?
или файлы без «=>» означают не найденные зависимости. 

спасибо! значит проблема конкретно в драйвере PSQL. пойду копать в эту сторону

[вложение удалено администратором]


если что-то не так ldd «not found» пишет




Спасибо еще раз (в сотый уже?  ::))
но не помогло.
По ссылке графический установщик qt 5.6.2, который я собственно установила уже, предварительно все галочки выставив.
Так же я установила библиотечку sudo apt-get install libqt5sql5-psql
вот ее не было.
и вот это сделала
wget http://launchpadlibrarian.net/75954717/libmysqlclient16_5.1.58-1ubuntu1_amd64.deb
sudo dpkg -i ./libmysqlclient16_5.1.58-1ubuntu1_amd64.deb
но тоже не помогло. 
остальные все библиотечки есть.


Екатерина, зачем вы выполняете советы тех, кто не разбирается в диагностике. зачем вам вообще deb пакеты сторонние в системе и sql? вы будете писать взаимодействие с SQL?
изначально проблема какая была?

Цитата: Екатерина от 03 марта 2017, 14:56:09При попытке запустить проект не находит QtCore/QCommandLineParser

какой проект? новый?

Цитата: Екатерина от 03 марта 2017, 14:56:09так же сам файл лежит в системе по пути
./usr/include/x86_64-linux-gnu/qt5/qtcore/qcommandLineParser. Как сделать так, чтобы qt ее увидел и проект запустился?

для того чтобы понять где он ищет этот файл, нужно запустить сам QT из gui терминала (а не по ярлыку). Тогда после того как он выдаст ошибку — в терминале возможно будет полезная информация!
+ всегда нужно начинать с изучения системных логов. частенько программы спамят в syslog.


  • Home
  • Forum
  • Qt
  • Qt Programming
  • Problems when adding serialport module in Qt project

  1. Default Problems when adding serialport module in Qt project

    Hi,
    I need to use QSerialport in my Qt project. Following the official documentation, I added

    1. QT += serialport

    To copy to clipboard, switch view to plain text mode 

    to my .pro file. After doing this, the build always fails, giving the error: «Unknown module(s) in QT: serialport». I am using Qt Creator 4.1.0 based on Qt 5.6.1. What am I missing?
    Thank you.


  2. Default Re: Problems when adding serialport module in Qt project

    try installing qt5-qtserialport-devel with your favorite package manager (I assume you are on linux based on your profile information)


  3. Default Re: Problems when adding serialport module in Qt project

    Hi high_flyer,
    my develop PC runs Ubuntu 16.04. Is it possible I cannot find the package you suggested?
    How can I make sure which Qt version am I using in my project?
    Thank you.


  4. Default Re: Problems when adding serialport module in Qt project

    Hi, according to packages.ubuntu.com the package is called libqt5serialport5 and libqt5serialport5-dev.

    Ginsengelf


  5. Default Re: Problems when adding serialport module in Qt project

    Since I need to cross-compile for my device running linux Yocto, is there a different way to include the serial port module in my Qt project? Are the drivers/libraries different?
    Thanks.


  6. Default Re: Problems when adding serialport module in Qt project

    I don’t understand.
    Yocto is not a distro — its a packaging tool, a distro maker if you will.

    If you are cross compiling you will need a cross compiled version of Qt as well.
    The serial port module is available on all Qt supported platform *I think* — but the docs can probably help.


Similar Threads

  1. Replies: 4

    Last Post: 5th April 2018, 09:09

  2. Replies: 6

    Last Post: 11th October 2014, 12:45

  3. Replies: 4

    Last Post: 11th March 2013, 22:54

  4. Replies: 11

    Last Post: 25th April 2012, 13:24

  5. Replies: 0

    Last Post: 26th April 2009, 18:55

Tags for this Thread

Bookmarks

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
  •  
  • BB code is On
  • Smilies are On
  • [IMG] code is On
  • [VIDEO] code is On
  • HTML code is Off

Forum Rules

Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.

Понравилась статья? Поделить с друзьями:
  • Project error unknown module s in qt core gui quick
  • Project error unknown module s in qt core gui network widgets
  • Project error failed to parse qmlimportscanner output
  • Project error cannot run compiler cl output
  • Project error building qtqml requires python