diff --git a/SleepyHeadQT.pro b/SleepyHeadQT.pro index 9d700738..f4c2c88e 100644 --- a/SleepyHeadQT.pro +++ b/SleepyHeadQT.pro @@ -103,7 +103,7 @@ macx { win32 { SOURCES += qextserialport/win_qextserialport.cpp qextserialport/qextserialenumerator_win.cpp DEFINES += WINVER=0x0501 # needed for mingw to pull in appropriate dbt business...probably a better way to do this - LIBS += -lsetupapi + LIBS += -lsetupapi -lz } diff --git a/qextserialport/qextserialenumerator_win.cpp b/qextserialport/qextserialenumerator_win.cpp index 6026b545..f001e70b 100644 --- a/qextserialport/qextserialenumerator_win.cpp +++ b/qextserialport/qextserialenumerator_win.cpp @@ -124,7 +124,7 @@ void QextSerialEnumerator::setUpNotifications( ) dbh.dbcc_size = sizeof(dbh); dbh.dbcc_devicetype = DBT_DEVTYP_DEVICEINTERFACE; CopyMemory(&dbh.dbcc_classguid, &GUID_DEVCLASS_PORTS, sizeof(GUID)); - if( RegisterDeviceNotification( notificationWidget->winId( ), &dbh, DEVICE_NOTIFY_WINDOW_HANDLE ) == NULL) + if( RegisterDeviceNotification( (HANDLE)notificationWidget->winId( ), &dbh, DEVICE_NOTIFY_WINDOW_HANDLE ) == NULL) qWarning() << "RegisterDeviceNotification failed:" << GetLastError(); // setting up notifications doesn't tell us about devices already connected // so get those manually