私はいくつかの質問を見て、たくさんグーグルで検索しましたが、arduino との間で読み書きするために、qextserialport を使用してシリアル ポート オブジェクトを宣言する方法が見つかりません。Qextserialport を使用してシリアル ポートに書き込む方法でユーザーが行ったことを試しましたが、コンパイラは次のエラーを表示します。
undefined reference to `QextSerialPort::QextSerialPort(QString const&, QextSerialPort::QueryMode, QObject*)'
私が使用しているコードは次のとおりです。
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QtExtSerialPort/qextserialport.h>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_BTN_Connect_clicked()
{
int index=ui->Selector_Port->currentIndex();
QextSerialPort *port = new QextSerialPort("/dev/ttyACM0");
}
このエラーが表示されるのはなぜですか? Debian 8.2 と QT 4.8.6 を使用しています
編集: 行を追加した後:
CONFIG += qesp_linux_udev
QT += extserialport
プロジェクト ファイルに次のエラーが表示されます。
"Project MESSAGE: Warning: unknown QT: extserialport"