Библиотеки Bluez вызывают много проблем

Я пытаюсь скомпилировать проект C ++ на Raspberry Pi B + в кодовых блоках. Код взят из Вот

#include <iostream>
#include <cstdint>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/socket.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>

using namespace std;

int main()
{
//cout << "Hello world!" << endl;
inquiry_info *li = NULL;
int max_rsp, num_rsp;
int dev_id, sock, len, flags;
int i;
char addr[19] = {0};
char name[248] = {0};

dev_id = hci_get_route(NULL);
sock = hci_open_dev(dev_id);
if(dev_id < 0||sock < 0)
{
perror("opening socket");
exit(1);
}
len=8;
max_rsp = 255;
flags = IREQ_CACHE_FLUSH;
li = (inquiry_info*)malloc(max_rsp * sizeof(inquiry_info));

num_rsp = hci_inquiry(dev_id, len, max_rsp, NULL, &li, flags);
if(num_rsp) perror("hci_inquiry");

for(i = 0; i < num_rsp; i++)
{
ba2str(&(li+i)->bdaddr, addr);
memset(name, 0, sizeof(name));
if(hci_read_remote_name(sock, &(li+i)->bdaddr, sizeof(name), name, 0) < 0) strcpy(name, "[unknown]");
printf("%s %s\n", addr, name);
}

free(li);
close(sock);
return 0;
}

GCC 4.6 с флагом [std = c ++ 0x] выдает мне следующие ошибки:

/home/pi/bluez-5.11/lib/bluetooth/hci.h|315|error: ‘uint8_t’ does not name a type|
/home/pi/bluez-5.11/lib/bluetooth/hci.h|316|error: ‘uint8_t’ does not name a type|
/home/pi/bluez-5.11/lib/bluetooth/hci.h|317|error: ‘uint8_t’ does not name a type|
/home/pi/bluez-5.11/lib/bluetooth/hci.h|322|error: ‘uint8_t’ does not name a type|
/home/pi/bluez-5.11/lib/bluetooth/hci.h|323|error: ‘bdaddr_t’ does not name a type|
/home/pi/bluez-5.11/lib/bluetooth/hci.h|331|error: ‘uint16_t’ does not name a type|
/home/pi/bluez-5.11/lib/bluetooth/hci.h|332|error: ‘uint16_t’ does not name a type|

Как видите, у меня есть <cstdint> а также using namespace std линий. Что я делаю неправильно?

0

Решение

Задача ещё не решена.

Другие решения