2017-09-13 96 views
0

我正在研究Windows上的簡單應用程序來掃描串行端口。 錯誤:對`_imp___ZN15QSerialPortInfo14availablePortsEv'的未定義引用'

undefined reference to `_imp___ZN15QSerialPortInfo14availablePortsEv' 

我的代碼:

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

    } 

什麼是錯誤的含義及如何解決它。

+0

https://stackoverflow.com/questions/12573816/what-is-an-undefined-reference-unresolved-external-symbol-error-and-how-do-i-fix –

+0

這個問題涉及到「外部符號錯誤「,我的錯誤沒有。所以我認爲這是無關緊要的。 – GeneCode

+1

我認爲這應該可以幫助你https://stackoverflow.com/questions/23335157/undefined-reference-to-imp-zn10httpclient5abortev-and-others – Naidu

回答

0

我只需要在我的項目(appname.pro)文件中添加QT += serialport