PDA

View Full Version : trouble with the QSerialPortInfo::availablePorts()



xiongxiongchuan
22nd June 2014, 05:05
i user the QT5.3 and visual studio 2010


foreach (const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) {
QStringList list;
description = info.description();
manufacturer = info.manufacturer();
list << info.portName()
<< (!description.isEmpty() ? description : blankString)
<< (!manufacturer.isEmpty() ? manufacturer : blankString)
<< info.systemLocation()
<< (info.vendorIdentifier() ? QString::number(info.vendorIdentifier(), 16) : blankString)
<< (info.productIdentifier() ? QString::number(info.productIdentifier(), 16) : blankString);

ui.serialPortInfoListBox->addItem(list.first(), list);
}


i use QSerialPortInfo::availablePorts() to read avaiablePorts of my PC,but there is always something wrong with it ,the error information is :


SerialPortSettingDialog.obj : error LNK2019: æ— æ³•è§£æžçš„å¤–éƒ¨ç¬ ¦å· "__declspec(dllimport) public: static class QList<class QSerialPortInfo> __cdecl QSerialPortInfo::availablePorts(void)" (__imp_?availablePorts@QSerialPortInfo@@SA?AV?$QLi st@VQSerialPortInfo@@@@XZ),该符号 在函数 "private: void __thiscall SerialPortSettingDialog::fillPortsInfo(void)" (?fillPortsInfo@SerialPortSettingDialog@@AAEXXZ) ä¸*被引用

xiongxiongchuan
22nd June 2014, 09:42
i have solved this problem , thanks