I want to use uci.h and iwlib.h in building a package for openwrt .
I followed this https://openwrt.org/docs/guide-developer/helloworld/start link to start the process and i can build simple files using other headers available in staging_dir/toolchain-mipsel_24kc_gcc-7.5.0_musl/include/
but i cannot find header files for uci.h and iw.h anywhere in the source directory. If i need to add these header files where do i add them ?
What do i need to do to build packages using these header files ?
Hello I am looking to build a simple application that uses iwlib.h API rather than system calls to the iw commands. What might be a path that i can take ?
I guess in the make menuconfig there is a libraries menu which contains libiw which i am guessing is a archive(.a) file but i cannot find where that is stored and how can i access the iwlib.h api to create a package i am a bit confused on that .
This is the simple package i am trying to build which parses the output of iw wlan0 survey dump and find the best channel to change using some algorithm. The algorithm is basic and wont be used in a real scenario but i am trying to learn the process on how to use this. How can i include all the functionalities of iwlib.h?
Sorry if i am asking simple questions but i am new to package development.
root@OpenWrt:~/meshwhtlst# gcc -liw wifi-scan.c
/usr/bin/ld: cannot find -liw
collect2: error: ld returned 1 exit status
First you have to create the Makefile in your project, but it is not a trivial task and you have to look for examples.
Second you have to add your feeding directory with your package to the feeds.conf according to this manual.
Hmm yes i have also been using the system calls instead of library but these will i guess add a lot of overhead for the code.
The code here is actually really simple and i can build my package with this code also but i am guessing i am missing something here regarding makefiles which is not allowing me to include the iwlib.h and other libraries and functionalities other than standard linux headers like stdlib.h and stdio.h.
So this code works in the openwrt using the toolchain as per the link https://openwrt.org/docs/guide-developer/helloworld/chapter3 but for additional api's i am having issues.
Hello I found the problem. (solved)
The actual problem for the toolchain was that i did not put DEPENDS:= in the mainfest file
For eg. as i am using iwlib.h which calls the library libiw i need to add the libiw in the DEPENDS of the manifest file
For eg: DEPENDS:= +libiw
what actually happens is the toolchain downloads all the required files and compiles the libiw for the target if i add DEPENDS.
Also in the makefile for the package i need to add -liw to the end of make command to denote that i am using the package libiw (.so) file .