including wpa_ctrl.h in a C code

瘦欲@ 提交于 2019-12-13 05:11:09

问题


I would like to add wpa_ctrl.h on a C code, and the source code has the following header files:

#include "includes.h"
#include "common.h"

how do I suppose to have them? Do I need to install any package or do they suppose to be at the kernel header files or in the include path? If I need to include it manually, then each file depends on some many header files that needs to be added manually, is there a convenient way to add the files that are needed


回答1:


These files are part of the hostapd project, and internal header files that won't be installed so you can't just include them after installing the package.

You'd be probably better off just ripping out the parts from wpa_ctrl.h you need. Depending on what you need it might be even better to use e.g. the DBus interface to communicate with wpa_supplicant (if that's what you want).




回答2:


You get them from wpa_supplicant source code.

Here's where to find them:

wpa_supplicant-2.4/src/utils/includes.h wpa_supplicant-2.4/src/utils/common.h

I copied them into my project directory and everything worked.

Here's where to find the source code:

https://w1.fi/releases/



来源:https://stackoverflow.com/questions/19822882/including-wpa-ctrl-h-in-a-c-code

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!