Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/c/71.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 蓝牙c+的未定义头+;_C++_C_Bluetooth_Include - Fatal编程技术网

C++ 蓝牙c+的未定义头+;

C++ 蓝牙c+的未定义头+;,c++,c,bluetooth,include,C++,C,Bluetooth,Include,我想获取并打印有关蓝牙设备的信息。 这是执行此操作的代码: #include <bluetooth/bluetooth.h> #include <bluetooth/hci.h> #include <bluetooth/hci_lib.h> #include <stdio.h> #include <string.h> /* for strncpy */ #include <sys/types.h> #include &l

我想获取并打印有关蓝牙设备的信息。 这是执行此操作的代码:

#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
#include <bluetooth/hci_lib.h>
 #include <stdio.h>

#include <string.h> /* for strncpy */
#include <sys/types.h>
#include <sys/socket.h>

 #include <sys/ioctl.h>
  #include <netinet/in.h>
   #include <unistd.h>
 #include <netinet/in.h>
#include <arpa/inet.h>
#include <cstdio>
#include <time.h>
#include <linux/wireless.h>

  static int dev_info(int s, int dev_id, long arg)
 {
 struct hci_dev_info di = { dev_id: dev_id };
 char addr[18];
 if (ioctl(s, HCIGETDEVINFO, (void *) &di))
 return 0;
 ba2str(&di.bdaddr, addr);
  printf("\t%s\t%s\n", di.name, addr);
  return 0;
   }
#包括
#包括
#包括
#包括
#包括/*用于strncpy*/
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
#包括
静态int dev_info(int s,int dev_id,long arg)
{
结构hci_dev_info di={dev_id:dev_id};
char addr[18];
if(ioctl(s、HCIGETDEVINFO、(void*)和di))
返回0;
ba2str(&di.bdaddr,addr);
printf(“\t%s\t%s\n”,di.name,addr);
返回0;
}

但我的Eclipse C++没有识别这些标题:

   #include <bluetooth/bluetooth.h>
    #include <bluetooth/hci.h>
   #include <bluetooth/hci_lib.h>
#包括
#包括
#包括

您能帮助我吗?

这是配置Eclipse的问题-StackOverflow更适合于编程问题您是什么意思?请您详细描述一下好吗?问题不在代码中,而是在Eclipse设置中。我不记得具体是怎么做的,但是你需要向你的项目添加include路径(你还需要确保你确实安装了BT头)。我尝试了很多,但我无法解决我的问题。是否可以帮我更多我得到了它。使用apt-get-install命令安装针对LINUX的blueZ软件包。