Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QSerialPort windows problem
Qt 6.11 is out! See what's new in the release blog

QSerialPort windows problem

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 1.9k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • yczoY Offline
    yczoY Offline
    yczo
    wrote on last edited by
    #1

    Newly installed qt creator, i don't know if an add-onis needed (Qt Creator 4.0 based on Qt 5.6)

    a terminal program. only main.cpp

    #include <QCoreApplication>
    #include <QtSerialPort/QSerialPort>
    #include <QtSerialPort/QSerialPortInfo>

    int main(int argc, char *argv[])
    {
    QCoreApplication a(argc, argv);
    QSerialPort serial;

    return a.exec();
    

    }

    When I add QSerialPort serial;, I obtain the following errors:

    main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: __cdecl QSerialPort::QSerialPort(class QObject *)" (_imp??0QSerialPort@@QEAA@PEAVQObject@@@Z) referenced in function main

    main.obj:-1: error: LNK2019: unresolved external symbol "__declspec(dllimport) public: virtual __cdecl QSerialPort::~QSerialPort(void)" (_imp??1QSerialPort@@UEAA@XZ) referenced in function main

    debug\QSerialPortProbe.exe:-1: error: LNK1120: 2 unresolved externals

    Like always, please some help will be wellcomed.

    Thanks in advance. Greetings

    1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      hi
      do you have
      QT += serialport
      in the .pro file?

      1 Reply Last reply
      3
      • yczoY Offline
        yczoY Offline
        yczo
        wrote on last edited by
        #3

        No, that fixed the problem. Thank you very much!

        1 Reply Last reply
        1

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved