1.編譯libnl1.1問題
In file included from addr.c:28:0:
../include/netlink-local.h: In function '__str2type':
../include/netlink-local.h:218:11: error: 'ULONG_MAX' undeclared (first use in this function)
../include/netlink-local.h:218:11: note: each undeclared identifier is reported only once for each function it appears in
../include/netlink-local.h: In function '__list_str2type':
../include/netlink-local.h:239:11: error: 'ULONG_MAX' undeclared (first use in this function)
make[2]: *** [addr.o] Error 1
make[1]: *** [all] Error 2
make: *** [all] Error 2
修改方法:
在 ./include/netlink-local.h 中增加頭文件
?#include <limits.h>
2.修改wpa_supplicant 2.2 Makefile
修改Makefile之前,需要執行config的拷貝
?cp defconfig .config
修改Makefile如下:
CC:=/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/bin/mips-linux-gnu-gcc
#ifndef CC
#CC=gcc
#endif
CFLAGS:= -I /home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/usr/include
CFLAGS += -I /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/include
CFLAGS += -I /home/xuxuequan/Ingenicwork/lib/libsource/libnl-1.1/include
LIBS := -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lssl
LIBS := -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
LIBS += -L /home/xuxuequan/Ingenicwork/lib/libsource/libnl-1.1/install/lib -lnl?
LIBDIR := ./out/lib/
BINDIR := ./out/sbin/
#ifndef CFLAGS
#CFLAGS = -MMD -O2 -Wall -g
#endif
#export LIBDIR ?= /usr/local/lib/
#export BINDIR ?= /usr/local/sbin/
#LIBS += -lcrypto
LIBS += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
#LIBS_p += -lcrypto
LIBS_p += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
3.wpa_supplicant 2.2編譯問題
問題一:
../src/drivers/driver_nl80211.c:19:31: fatal error: netlink/genl/genl.h: No such file or directorycompilation terminated.
make: *** [../src/drivers/driver_nl80211.o] Error 1
問題分析:
這是由于沒有libnl庫導致的,在Makefile中設置libnl的相關include即可
問題二:
../src/drivers/driver_nl80211.c: In function 'family_handler':
../src/drivers/driver_nl80211.c:717:10: error: 'CTRL_ATTR_MCAST_GROUPS' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:717:10: note: each undeclared identifier is reported only once for each function it appears in
../src/drivers/driver_nl80211.c:721:22: error: 'CTRL_ATTR_MCAST_GRP_MAX' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:724:12: error: 'CTRL_ATTR_MCAST_GRP_NAME' undeclared (first use in this function)
../src/drivers/driver_nl80211.c:725:12: error: 'CTRL_ATTR_MCAST_GRP_ID' undeclared (first use in this function)
make: *** [../src/drivers/driver_nl80211.o] Error 1
問題分析:
這是由于當前libnl庫版本中genetlink.h文件部分定義沒有導致的,可以從交叉編譯工具鏈中拷貝一個
cp /home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/mips-linux-gnu/libc/usr/include/linux/genetlink.h ./genetlink.h?
問題三:
/home/xuxuequan/Ingenicwork/toolchain/mips-gcc472-glibc216-32bit/bin/../lib/gcc/mips-linux-gnu/4.7.2/../../../../mips-linux-gnu/bin/ld: cannot find -lcrypto
collect2: error: ld returned 1 exit status
make: *** [wpa_passphrase] Error 1
問題分析:
這是由于Makefile中如下部分定義導致的,按照紅色部分修改為交叉編譯
#LIBS += -lcrypto
LIBS += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto
#LIBS_p += -lcrypto
LIBS_p += -L /home/xuxuequan/Ingenicwork/lib/libsource/openssl-1.0.1h/install/lib -lcrypto