QextSerialPort, QextSerialEnumerator, VS2008 issue
Hi all,
I have problem with compilation of QextSerialEnumerator example from QextSerialPort lib.
I use Qt 4.6 + VS2008.
I compiled library (version from https://qextserialport.googlecode.com/hg/) so I have 4 files - lib and dll for debug and release.
Event example compiled without errors, but I cannot compile enumerator example.
The problem occurs when I call QextSerialEnumerator::getPorts();.
during compilation I get unresolved externals errors.
As I remember I hadn't this issue with MinGW compiler ...
Thx in advance!
Re: QextSerialPort, QextSerialEnumerator, VS2008 issue
and those unresolved externals are?
Re: QextSerialPort, QextSerialEnumerator, VS2008 issue
Sorry...
Code:
qextserialport.lib(qextserialenumerator.obj) : error LNK2019: unresolved external symbol __imp__SetupDiGetDeviceRegistryPropertyW@28 referenced in function "private: static class QString __cdecl QextSerialEnumerator::getDeviceProperty(void *,struct _SP_DEVINFO_DATA *,unsigned long)" (?getDeviceProperty@QextSerialEnumerator@@CA?AVQString@@PAXPAU_SP_DEVINFO_DATA@@K@Z)
qextserialport.lib(qextserialenumerator.obj) : error LNK2019: unresolved external symbol __imp__SetupDiOpenDevRegKey@24 referenced in function "private: static bool __cdecl QextSerialEnumerator::getDeviceDetailsWin(struct QextPortInfo *,void *,struct _SP_DEVINFO_DATA *,unsigned int)" (?getDeviceDetailsWin@QextSerialEnumerator@@CA_NPAUQextPortInfo@@PAXPAU_SP_DEVINFO_DATA@@I@Z)
qextserialport.lib(qextserialenumerator.obj) : error LNK2019: unresolved external symbol __imp__SetupDiDestroyDeviceInfoList@4 referenced in function "private: bool __thiscall QextSerialEnumerator::matchAndDispatchChangedDevice(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerator@@AAE_NABVQString@@ABU_GUID@@I@Z)
qextserialport.lib(qextserialenumerator.obj) : error LNK2019: unresolved external symbol __imp__SetupDiGetDeviceInstanceIdW@20 referenced in function "private: bool __thiscall QextSerialEnumerator::matchAndDispatchChangedDevice(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerator@@AAE_NABVQString@@ABU_GUID@@I@Z)
qextserialport.lib(qextserialenumerator.obj) : error LNK2019: unresolved external symbol __imp__SetupDiEnumDeviceInfo@12 referenced in function "private: bool __thiscall QextSerialEnumerator::matchAndDispatchChangedDevice(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerator@@AAE_NABVQString@@ABU_GUID@@I@Z)
qextserialport.lib(qextserialenumerator.obj) : error LNK2019: unresolved external symbol __imp__SetupDiGetClassDevsW@16 referenced in function "private: bool __thiscall QextSerialEnumerator::matchAndDispatchChangedDevice(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerator@@AAE_NABVQString@@ABU_GUID@@I@Z)
Also I couldn't compile lib from cmd (qmake, nmake) I imported proj. to VS (qmake -tp vc) and then was ok.
Thx in advance!
Re: QextSerialPort, QextSerialEnumerator, VS2008 issue
Add '#pragma comment (lib, "Setupapi.lib")' to your source file.