net/if.hとlinux/if.hの混在
dynamicsをコンパイルしようとしたら、ちょっとしたコンパイルエラーにぶつかったのでメモ。
1番目は、
In file included from monitor.h:21, from mn_agentadv.c:40: /usr/include/linux/wireless.h:896: error: ‘IFNAMSIZ’ undeclared here (not in a function)
これはmonitor.hの中で、#include
2番目は、
/usr/include/linux/if.h:119: error: redefinition of ‘struct ifmap’ /usr/include/linux/if.h:155: error: redefinition of ‘struct ifreq’ /usr/include/linux/if.h:205: error: redefinition of ‘struct ifconf’
という2種類のエラーが出た。色々ぐぐって見ると、どうやら#include
どちらに統一したらいいのか迷ったけれども、とりあえずGoogle先生に2つのファイル名でぐぐってみて、net/if.hの方がヒット数が多かったというだけの理由でnet/if.hに統一した。
これでとりあえず一通りのコンパイルは通った。まだ動作確認はしていない。