I have a problem with my c++ bluetooth class. I work on a school project and have to write a function that show the paired bluetooth devices. Usually I programm in other languages, therefore my c++ knowledge isn't very well.
I've got the following error messages:
LNK2019 Verweis auf nicht aufgelöstes externes Symbol "_BluetoothFindFirstDevice@8" in Funktion ""public: void __thiscall bluetooth::showPairedDevices(void)" (?showPairedDevices@bluetooth@@QAEXXZ)"
.
LNK2019 Verweis auf nicht aufgelöstes externes Symbol "_BluetoothFindNextDevice@8" in Funktion ""public: void __thiscall bluetooth::showPairedDevices(void)" (?showPairedDevices@bluetooth@@QAEXXZ)"
The sourcecode:
#pragma once
#include "iostream"
#include "stdlib.h"
#include "stdio.h"
#include "Winsock2.h"
#include "Ws2bth.h"
#include "BluetoothAPIs.h"
#include "WinBase.h"
class bluetooth
{
public:
bluetooth();
~bluetooth();
void showPairedDevices();
};
void bluetooth::showPairedDevices() {
HBLUETOOTH_DEVICE_FIND foundedDevice;
BLUETOOTH_DEVICE_INFO deviceInfo;
deviceInfo.dwSize = sizeof(deviceInfo);
BLUETOOTH_DEVICE_SEARCH_PARAMS searchCriteria;
searchCriteria.dwSize = sizeof(BLUETOOTH_DEVICE_SEARCH_PARAMS);
searchCriteria.fReturnAuthenticated = TRUE;
searchCriteria.fReturnRemembered = FALSE;
searchCriteria.fReturnConnected = FALSE;
searchCriteria.fReturnUnknown = FALSE;
searchCriteria.fIssueInquiry = FALSE;
searchCriteria.cTimeoutMultiplier = 0;
searchCriteria.hRadio = NULL;
foundedDevice = BluetoothFindFirstDevice(&searchCriteria, &deviceInfo);
if (foundedDevice == NULL) {
std::cout << "no devices found";
} else {
do {
std::cout << "founded device: " << deviceInfo.szName << std::endl;
} while (BluetoothFindNextDevice(foundedDevice, &deviceInfo));
}
return;
};
Hope you can help me!
Regards