i user the QT5.3 and visual studio 2010

Qt Code:
  1. foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
  2. description = info.description();
  3. manufacturer = info.manufacturer();
  4. list << info.portName()
  5. << (!description.isEmpty() ? description : blankString)
  6. << (!manufacturer.isEmpty() ? manufacturer : blankString)
  7. << info.systemLocation()
  8. << (info.vendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : blankString)
  9. << (info.productIdentifier() ? QString::number(info.productIdentifier(), 16) : blankString);
  10.  
  11. ui.serialPortInfoListBox->addItem(list.first(), list);
  12. }
To copy to clipboard, switch view to plain text mode 


i use QSerialPortInfo::availablePorts() to read avaiablePorts of my PC,but there is always something wrong with it ,the error information is :
Qt Code:
  1. SerialPortSettingDialog.obj : error LNK2019: æ— æ³•è§£æžçš„å¤–éƒ¨ç¬¦å· "__declspec(dllimport) public: static class QList<class QSerialPortInfo> __cdecl QSerialPortInfo::availablePorts(void)" (__imp_?availablePorts@QSerialPortInfo@@SA?AV?$QList@VQSerialPortInfo@@@@XZ),该符号在函数 "private: void __thiscall SerialPortSettingDialog::fillPortsInfo(void)" (?fillPortsInfo@SerialPortSettingDialog@@AAEXXZ) ä¸*被引用
To copy to clipboard, switch view to plain text mode