-1

when I develop on openwrt , I include ieee80211.h in my program, but when I compile ,the console reminds me ieee80211.h not found.Then I set the include path like this #include"/home/openwrtsdk/build_dir/build_dir/target_mips_34kc_uClibc_0.9.33.2/linux_firmware52442afee9907bc32a058f22bb3295d040677c26/carl9170fw/include/linux/ieee80211.h", And compile, it also doesn't work,and has following:

error:
/home/xuwy/openwrt/OpenWrt-SDK-15.05.1-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-firmware-52442afee9907bc32a058f22bb3295d040677c26/carl9170fw/include/linux/ieee80211.h:897:2: error: unknown type name '__le16'   __le16 control;   

error: /home/xuwy/openwrt/OpenWrt-SDK-15.05.1-ar71xx-nand_gcc-4.8-linaro_uClibc-0.9.33.2.Linux-x86_64/build_dir/target-mips_34kc_uClibc-0.9.33.2/linux-firmware-52442afee9907bc32a058f22bb3295d040677c26/carl9170fw/include/linux/ieee80211.h:898:2: error: unknown type name '__le16'
  __le16 start_seq_num;

Now, I don't have any idea on this, any one can help?

Gynteniuxas
  • 7,035
  • 18
  • 38
  • 54
wiliam xu
  • 11
  • 1

1 Answers1

2

This is one of those implicitly inferred sorta things; but the paths of include files cannot be absolute. The compiler has its own built-in PATH-like variable for compilation that gets populated by a list of default directories (eg. /usr/include and /usr/local/include) and directories that are specified by the user via the POSIX standard -I option. To include your header, compile your program with the additional -I option as you see below.

cc -o myprogram main.c -I "/home/openwrtsdk/build_dir/build_dir
/target_mips_34kc_uClibc_0.9.33.2
/linux_firmware52442afee9907bc32a058f22bb3295d040677c26/carl9170fw
/include/linux"

... and in your source file, just add:

#include <ieee80211.h>
Stefan van den Akker
  • 6,661
  • 7
  • 48
  • 63
DeftlyHacked
  • 405
  • 2
  • 9