I'am trying to do an aplication with qt that show device description when connecting or disconnecting, but have problem with some setupapi unresolved method. This is the error that qt show
usbworker.obj:-1: error: LNK2019: unresolved external symbol __imp_SetupDiGetClassDescriptionA referenced in function "private: class ATL::CStringT<wchar_t,class StrTraitMFC_DLL<wchar_t,class ATL::ChTraitsCRT<wchar_t> > > __cdecl usbworker::GetClassDesc(struct _GUID const *)" (?GetClassDesc@usbworker@@AEAA?AV?$CStringT@_WV?$StrTraitMFC_DLL@_WV?$ChTraitsCRT@_W@ATL@@@@@ATL@@PEBU_GUID@@@Z)
and this is a part of my code
CString usbworker::GetClassDesc(const GUID* pGuid)
{
TCHAR buf[MAX_PATH];
DWORD size;
if ( SetupDiGetClassDescription(pGuid, buf, sizeof(buf), &size) ) {
return CString(buf);
} else {
TRACE("Can't get class description: %s", _com_error(GetLastError()).ErrorMessage());
return _T("");
}
}