0

I am working on simple app on windows to scan the serial port. Error:

undefined reference to `_imp___ZN15QSerialPortInfo14availablePortsEv'

My Code:

 foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
        // do something

    }

What does the error mean and how to fix it.

GeneCode
  • 7,545
  • 8
  • 50
  • 85
  • https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix – Leri Gogsadze Sep 13 '17 at 05:14
  • That question is related to "external symbol error" which my error does not have. So I think it is irrelevant. – GeneCode Sep 13 '17 at 05:37
  • 1
    I think this should help you https://stackoverflow.com/questions/23335157/undefined-reference-to-imp-zn10httpclient5abortev-and-others – Pavan Chandaka Sep 13 '17 at 05:48
  • Thanks katamarayudu. For my case i am using QT5 so i only needed to add "QT += serialport" in my project file. It works now. – GeneCode Sep 13 '17 at 06:20

1 Answers1

1

i only needed to add QT += serialport in my project (appname.pro) file.

GeneCode
  • 7,545
  • 8
  • 50
  • 85