PDA

View Full Version : QextSerialPort, QextSerialEnumerator, VS2008 issue



lasher
17th January 2010, 20:54
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!

squidge
17th January 2010, 22:54
and those unresolved externals are?

lasher
18th January 2010, 13:02
Sorry...



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?AVQSt ring@@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_NPA UQextPortInfo@@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::matchAndDispatchChangedDevic e(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerat or@@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::matchAndDispatchChangedDevic e(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerat or@@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::matchAndDispatchChangedDevic e(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerat or@@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::matchAndDispatchChangedDevic e(class QString const &,struct _GUID const &,unsigned int)" (?matchAndDispatchChangedDevice@QextSerialEnumerat or@@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!

squidge
18th January 2010, 13:06
Add '#pragma comment (lib, "Setupapi.lib")' to your source file.