Qt bluetooth wip/win branch for windows



  • Hi guys,

    I'm sorry but I can't find a solution about bluetooth on windows.
    Since it seems that qt 5.10 doesn't support bluetooth connectivity on windows (bluetooth examples always give me "Qt bluetooth module is not functional", but maybe I'm doing something wrong), I need to find a workaround.

    I've found this thread and I tried to follow the instructions but something is not working:
    https://forum.qt.io/topic/75402/bluetooth-with-windows-bluetooth-low-energy

    I've cloned the git, then I followed the instructions in the thread above but this is what happend:

    Setting up environment for Qt usage...
    
    C:\Qt\5.10.0\mingw53_32>cd..
    
    C:\Qt\5.10.0>cd..
    
    C:\Qt>cd..
    
    C:\>cd build_qtconnectivity
    
    C:\build_qtconnectivity>qmake c:\qtconnectivity
    WARNING: Failure to find: \src\bluetooth\android\androidbroadcastreceiver_p.h
    WARNING: Failure to find: \src\nfc\qndefnfcsmartposterrecord.h
    WARNING: Failure to find: \src\nfc\qndefnfctextrecord.h
    WARNING: Failure to find: \src\bluetooth\android\jni_android_p.h
    WARNING: Failure to find: \src\bluetooth\qtbluetoothglobal.h
    WARNING: Failure to find: \src\bluetooth\android\androidbroadcastreceiver_p.h
    WARNING: Failure to find: \src\nfc\qndefnfcsmartposterrecord.h
    WARNING: Failure to find: \src\nfc\qndefnfctextrecord.h
    WARNING: Failure to find: \src\bluetooth\android\jni_android_p.h
    WARNING: Failure to find: \src\bluetooth\qtbluetoothglobal.h
    
    C:\build_qtconnectivity>mingw32-make
    mingw32-make -f Makefile.Release
    mingw32-make[1]: Entering directory 'C:/build_qtconnectivity'
    Makefile.Release:5715: warning: overriding recipe for target '.moc/release/moc_remoteselector.cpp'
    Makefile.Release:5563: warning: ignoring old recipe for target '.moc/release/moc_remoteselector.cpp'
    Makefile.Release:6297: warning: overriding recipe for target '.moc/release/moc_device.cpp'
    Makefile.Release:5781: warning: ignoring old recipe for target '.moc/release/moc_device.cpp'
    Makefile.Release:6391: warning: overriding recipe for target '.moc/release/moc_deviceinfo.cpp'
    Makefile.Release:6093: warning: ignoring old recipe for target '.moc/release/moc_deviceinfo.cpp'
    Makefile.Release:6766: warning: overriding recipe for target '.moc/release/moc_mainwindow.cpp'
    Makefile.Release:6703: warning: ignoring old recipe for target '.moc/release/moc_mainwindow.cpp'
    Makefile.Release:12365: warning: overriding recipe for target '.moc/release/moc_adapter_p.cpp'
    Makefile.Release:7783: warning: ignoring old recipe for target '.moc/release/moc_adapter_p.cpp'
    Makefile.Release:12584: warning: overriding recipe for target '.moc/release/moc_agent_p.cpp'
    Makefile.Release:7997: warning: ignoring old recipe for target '.moc/release/moc_agent_p.cpp'
    Makefile.Release:13243: warning: overriding recipe for target '.moc/release/moc_manager_p.cpp'
    Makefile.Release:9017: warning: ignoring old recipe for target '.moc/release/moc_manager_p.cpp'
    Makefile.Release:14551: warning: overriding recipe for target '.moc/release/plugin.moc'
    Makefile.Release:14437: warning: ignoring old recipe for target '.moc/release/plugin.moc'
    Makefile.Release:21755: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:21752: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:21758: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:21755: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:21761: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:21758: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:32640: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:21761: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:33020: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:32640: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:33210: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:33020: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:33423: warning: overriding recipe for target '.obj/release/remoteselector.o'
    Makefile.Release:33114: warning: ignoring old recipe for target '.obj/release/remoteselector.o'
    Makefile.Release:33570: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:33210: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:34220: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:33570: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:34322: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:34220: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:34533: warning: overriding recipe for target '.obj/release/device.o'
    Makefile.Release:33506: warning: ignoring old recipe for target '.obj/release/device.o'
    Makefile.Release:34630: warning: overriding recipe for target '.obj/release/deviceinfo.o'
    Makefile.Release:34130: warning: ignoring old recipe for target '.obj/release/deviceinfo.o'
    Makefile.Release:34753: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:34322: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:35065: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:34753: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:35181: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:35065: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:35606: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:35181: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:35842: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:35606: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:35903: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:35842: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:35988: warning: overriding recipe for target '.obj/release/mainwindow.o'
    Makefile.Release:35694: warning: ignoring old recipe for target '.obj/release/mainwindow.o'
    Makefile.Release:38166: warning: overriding recipe for target '.obj/release/device.o'
    Makefile.Release:34533: warning: ignoring old recipe for target '.obj/release/device.o'
    Makefile.Release:41308: warning: overriding recipe for target '.obj/release/service.o'
    Makefile.Release:33664: warning: ignoring old recipe for target '.obj/release/service.o'
    Makefile.Release:42150: warning: overriding recipe for target '.obj/release/plugin.o'
    Makefile.Release:41715: warning: ignoring old recipe for target '.obj/release/plugin.o'
    Makefile.Release:42870: warning: overriding recipe for target '.obj/release/adapter.o'
    Makefile.Release:37182: warning: ignoring old recipe for target '.obj/release/adapter.o'
    Makefile.Release:43087: warning: overriding recipe for target '.obj/release/agent.o'
    Makefile.Release:37617: warning: ignoring old recipe for target '.obj/release/agent.o'
    Makefile.Release:43740: warning: overriding recipe for target '.obj/release/manager.o'
    Makefile.Release:38686: warning: ignoring old recipe for target '.obj/release/manager.o'
    Makefile.Release:44243: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:35903: warning: ignoring old recipe for target '.obj/release/main.o'
    Makefile.Release:51109: warning: overriding recipe for target '.obj/release/main.o'
    Makefile.Release:44243: warning: ignoring old recipe for target '.obj/release/main.o'
    g++ -c -fno-keep-inline-dllexport -O2 -std=gnu++11 -fno-exceptions -Wextra -Wall -W -DUNICODE -D_UNICODE -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_DEPRECATED_WARNINGS -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_NEEDS_QMAIN -IC:\qtconnectivity -I. -IC:\qtconnectivity -IC:\Qt\5.10.0\mingw53_32\include -IC:\Qt\5.10.0\mingw53_32\include\QtGui -IC:\Qt\5.10.0\mingw53_32\include\QtANGLE -IC:\Qt\5.10.0\mingw53_32\include\QtCore -I.moc\release -IC:\utils\my_sql\my_sql\include -IC:\utils\postgresql\pgsql\include -IC:\openssl\include -IC:\Qt\5.10.0\mingw53_32\mkspecs\win32-g++  -o .obj\release\lecmaccalculator.o C:\qtconnectivity\src\bluetooth\lecmaccalculator.cpp
    In file included from C:\qtconnectivity\src\bluetooth\lecmaccalculator.cpp:41:0:
    C:\qtconnectivity\src\bluetooth\bluez/bluez_data_p.h:56:24: fatal error: sys/socket.h: No such file or directory
    compilation terminated.
    Makefile.Release:21839: recipe for target '.obj/release/lecmaccalculator.o' failed
    mingw32-make[1]: *** [.obj/release/lecmaccalculator.o] Error 1
    mingw32-make[1]: Leaving directory 'C:/build_qtconnectivity'
    Makefile:36: recipe for target 'release' failed
    mingw32-make: *** [release] Error 2
    
    C:\build_qtconnectivity>
    

    Somebody can give me any advice? Or any links to follow step-by-step to get this branch work?

    thanks in advance!



  • @davidesalvetti hi,

    I'm currently also testing the waters with QtBluetooth. As far as I understand it, the module is not supported vor "regular" windows, but it works fine with UWP(Universal Windows Platform - used to be called WindowsRT), that means :

    • you'll have to install that package using the QtOnlineInstaller
    • You'll need MSVC2015 or 2017 compiler on your pc
    • You'll need the Windows Software developing kit
    • You than need to modify, localy preferable, your path and build environment to include the above

    And than the Qt-Bluetooth examples should run on windows.

    Edit:
    Nevermind, just went through the 5.10 Release notes, 5.10 supports now BTLE for windows 10> just tested it, seems to work fine.



  • but something is not working

    What's not working?

    To clone wip/win:

    git clone git://code.qt.io/qt/qtconnectivity.git
    cd qtconnectivity
    git checkout wip/win
    

    To build and install wip/win:

    Just open a *.pro file from QtC. Next, open the project's build options and add\write the 'install' target in make field. Rebuild the project. Thats all.



  • Hi @J.Hilk and thanks for your answer.

    I just tried to compile a BLE example on Qt 5.10 , when it starts it says "Qt Bluetooth module is not functional".
    I'm on Windows 10. It would be enough to have BTLE supports for now.


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.