C++ 为什么标题是“为什么?”;linux/if“ppp.h”;返回错误?
我想在我的代码中实现本文()中user@bunt01的解决方案: 它包括从“ppp0”接口读取RX和TXC++ 为什么标题是“为什么?”;linux/if“ppp.h”;返回错误?,c++,c,linux,interface,ppp,C++,C,Linux,Interface,Ppp,我想在我的代码中实现本文()中user@bunt01的解决方案: 它包括从“ppp0”接口读取RX和TX #include <linux/if_ppp.h> #include <net/if.h> #include <sys/ioctl.h> #include <sys/socket.h> #include <unistd.h> 我注意到这是由于包含了一个头文件: #include <li
#include <linux/if_ppp.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/socket.h>
#include <unistd.h>
我注意到这是由于包含了一个头文件:
#include <linux/if_ppp.h>
#包括
这可能是什么原因造成的?您可能需要在
linux/if\u ppp.h
之前加入linux/ppp\u defs.h
@M.G。它没有解决问题,在我的系统上运行良好”\_(ツ)_/''可能您的头文件已损坏?在我自己的系统上也是如此。无法重新编程。您的软件包版本是什么?我在“pppd-2.4.7”中有此头文件
/usr/include/linux/if_ppp.h:92:7: error: use of enum ‘NPmode’ without previous declaration
enum NPmode mode;
^
/usr/include/linux/if_ppp.h:103:16: error: field ‘b’ has incomplete type ‘ifreq’
struct ifreq b;
^
/usr/include/linux/if_ppp.h:104:19: error: field ‘stats’ has incomplete type ‘ppp_stats’
struct ppp_stats stats; /* statistic information */
^
/usr/include/linux/if_ppp.h:108:21: error: field ‘b’ has incomplete type ‘ifreq’
struct ifreq b;
^
usr/include/linux/if_ppp.h:109:24: error: field ‘stats’ has incomplete type ‘ppp_comp_stats’
struct ppp_comp_stats stats;
#include <linux/if_ppp.h>