1>c:\program files (x86)\windows kits\8.0\include\um\bluetoothleapis.h(658): error C2373: “PFNBLUETOOTH_GATT_EVENT_CALLBACK”: 重定义;不同的类型修饰符
1> c:\program files (x86)\windows kits\8.0\include\um\bthledef.h(349) : 参见“PFNBLUETOOTH_GATT_EVENT_CALLBACK”的声明
#include <stdio.h>
#include <windows.h>
#include <setupapi.h>
#include <devguid.h>
#include <regstr.h>
#include <bthdef.h>
#include <Bluetoothleapis.h>
#pragma comment(lib, "SetupAPI")
#pragma comment(lib, "BluetoothApis.lib")
#define TO_SEARCH_DEVICE_UUID "{0000180D-0000-1000-8000-00805F9B34FB}" //we use UUID for an HR BLE device
2 个解决方案
#1
https://social.msdn.microsoft.com/Forums/zh-CN/5d248e7d-0534-45ac-8e84-24dead317634/win32-bluetooth-le-apis-error-c2373
https://social.msdn.microsoft.com/Forums/zh-CN/5d248e7d-0534-45ac-8e84-24dead317634/win32-bluetooth-le-apis-error-c2373
#2
头文件冲突了。调整一下h文件顺序
#1
https://social.msdn.microsoft.com/Forums/zh-CN/5d248e7d-0534-45ac-8e84-24dead317634/win32-bluetooth-le-apis-error-c2373
https://social.msdn.microsoft.com/Forums/zh-CN/5d248e7d-0534-45ac-8e84-24dead317634/win32-bluetooth-le-apis-error-c2373
#2
头文件冲突了。调整一下h文件顺序