Important: Please read the Qt Code of Conduct -

QTSerialPort Problem

  • Dear all:
    I'm new user on QT. Now I want to use function of class that name "QSerialPort", i can include the .h file and Qt Creator also recognize them, but when i compiled, I got faults. The content of fault is following:

    "LINK2019: unresolved external symbol "__declspec(dllimport)public: virtual _thiscall QSP::~QSerialPort(void)" (_imp??1QSerialPort@@UAE@XZ referenced in function _main"

    It seems is QT can't find the definition of function in "QSerialPort", my computer is 64-bit and compiler is "Microsoft Visual C++ Compiler 10.0(x86)", Qt version is "Qt 5.1.0(msvc2010) in my configuration, the QT I downloaded is 32-bit. Anyone has same problem ?? Or can someone give me some suggestions??

  • You need to tell Qt that you want to use the QSerialPort module. You can do this by adding the line

    QT += serialport

    to your .pro file.

    Good luck!

  • I resolved from your suggestions. Thank you :))

Log in to reply