当前位置: 技术问答>linux和unix
hostapd交叉编译出错,请高手指点
来源: 互联网 发布时间:2016-09-15
本文导语: 准备往ixp425上移植hostapd, 开始我用arm-linux-gcc 3.4.4 编译没有问题结果一直到板上 错误提示稍后补充 不能运行 我用file命令查看过,是可执行文件,也是arm架构,我又自己编译一个hello,world的程序,在板上依旧无法...
准备往ixp425上移植hostapd,
开始我用arm-linux-gcc 3.4.4 编译没有问题结果一直到板上
错误提示稍后补充
不能运行
我用file命令查看过,是可执行文件,也是arm架构,我又自己编译一个hello,world的程序,在板上依旧无法运行
有人给了个建议,说ixp425 编译的时候还需要ucfront-gcc的库
现在Makefile文件里是这样改的
CC=/ap/ixp425/snapgear/tools/ucfront-gcc /usr/local/arm/3.4.4/bin/arm-linux-gcc
编译的时候似乎出现预编译错误
我分析了一下错误,错误大致分为三类,一些数据结构未定义,size_t未定义,还有就是error: dereferencing pointer to incomplete type。
我看了源码,size_t是头文件stddef.h内定义的,数据结构定义的类型都是size_t,所以前两个问题基本可以归为一个,
下面的就不是很清楚了,stddef.h也没有说找不到,这是不是预编译的问题啊?我应该如何修改呢?还有后面的一个问题,希望高手能给指点一下。
开始我用arm-linux-gcc 3.4.4 编译没有问题结果一直到板上
错误提示稍后补充
不能运行
我用file命令查看过,是可执行文件,也是arm架构,我又自己编译一个hello,world的程序,在板上依旧无法运行
有人给了个建议,说ixp425 编译的时候还需要ucfront-gcc的库
现在Makefile文件里是这样改的
CC=/ap/ixp425/snapgear/tools/ucfront-gcc /usr/local/arm/3.4.4/bin/arm-linux-gcc
编译的时候似乎出现预编译错误
driver.h:568: error: `tail' undeclared (first use in this function)
driver.h:568: error: `tail_len' undeclared (first use in this function)
driver.h: In function `hostapd_set_dtim_period':
driver.h:592: error: dereferencing pointer to incomplete type
driver.h: In function `hostapd_if_add':
。。。
../src/crypto/tls.h:26: warning: data definition has no type or storage class
。。。
../src/crypto/tls.h:98: error: conflicting types for 'dh_file'
config.h:249: error: previous declaration of 'dh_file' was here
../src/crypto/tls.h:100: error: parse error before "dh_blob_len"
../src/crypto/tls.h:100: warning: type defaults to `int' in declaration of `dh_blob_len'
../src/crypto/tls.h:100: warning: data definition has no type or storage class
../src/crypto/tls.h:111: error: conflicting types for 'flags'
driver.h:25: error: previous declaration of 'flags' was here
../src/crypto/tls.h:112: error: parse error before '}' token
../src/crypto/tls.h:289: error: parse error before "size_t"
../src/crypto/tls.h:322: error: parse error before "size_t"
../src/crypto/tls.h:339: error: parse error before "size_t"
../src/crypto/tls.h:357: error: parse error before "size_t"
../src/crypto/tls.h:375: error: parse error before "size_t"
。。。
In file included from hostapd.c:43:
../src/eap_server/eap.h:38: error: parse error before "size_t"
../src/eap_server/eap.h:38: warning: no semicolon at end of struct or union
../src/eap_server/eap.h:45: error: parse error before '}' token
../src/eap_server/eap.h:65: error: parse error before "size_t"
../src/eap_server/eap.h:65: warning: no semicolon at end of struct or union
../src/eap_server/eap.h:75: error: parse error before "aaaEapKeyDataLen"
../src/eap_server/eap.h:75: warning: type defaults to `int' in declaration of `aaaEapKeyDataLen'
../src/eap_server/eap.h:75: warning: data definition has no type or storage class
../src/eap_server/eap.h:84: error: parse error before '}' token
../src/eap_server/eap.h:87: error: parse error before "size_t"
../src/eap_server/eap.h:89: error: parse error before "size_t"
../src/eap_server/eap.h:99: error: parse error before "size_t"
../src/eap_server/eap.h:99: warning: no semicolon at end of struct or union
../src/eap_server/eap.h:108: error: parse error before '}' token
../src/eap_server/eap.h:119: error: parse error before "size_t"
In file included from hostapd.c:44:
../src/eap_server/tncs.h:23: error: parse error before "tncs_total_send_len"
../src/eap_server/tncs.h:23: warning: type defaults to `int' in declaration of `tncs_total_send_len'
../src/eap_server/tncs.h:23: warning: data definition has no type or storage class
../src/eap_server/tncs.h:40: error: parse error before "size_t"
../src/eap_server/tncs.h:46: error: parse error before "size_t"
In file included from hostapd.c:46:
../src/l2_packet/l2_packet.h:68: error: parse error before "size_t"
../src/l2_packet/l2_packet.h:98: error: parse error before "size_t"
../src/l2_packet/l2_packet.h:114: error: parse error before "size_t"
In file included from hostapd.c:47:
。。。
hostapd.c: In function `hostapd_wpa_auth_get_eapol':
hostapd.c:878: error: dereferencing pointer to incomplete type
hostapd.c:880: error: dereferencing pointer to incomplete type
hostapd.c: At top level:
hostapd.c:896: error: parse error before "size_t"
hostapd.c: In function `hostapd_wpa_auth_get_msk':
hostapd.c:898: error: `ctx' undeclared (first use in this function)
hostapd.c:900: error: `size_t' undeclared (first use in this function)
hostapd.c:900: error: parse error before "keylen"
hostapd.c:903: error: `addr' undeclared (first use in this function)
hostapd.c:907: error: `keylen' undeclared (first use in this function)
hostapd.c:911: error: `len' undeclared (first use in this function)
hostapd.c:913: error: `msk' undeclared (first use in this function)
hostapd.c: At top level:
hostapd.c:922: error: parse error before "size_t"
hostapd.c: In function `hostapd_wpa_auth_set_key':
hostapd.c:924: error: `ctx' undeclared (first use in this function)
hostapd.c:925: error: dereferencing pointer to incomplete type
hostapd.c:927: error: `vlan_id' undeclared (first use in this function)
hostapd.c:928: error: dereferencing pointer to incomplete type
hostapd.c:933: error: `alg' undeclared (first use in this function)
hostapd.c:933: error: `addr' undeclared (first use in this function)
hostapd.c:933: error: `idx' undeclared (first use in this function)
hostapd.c:934: error: `key_len' undeclared (first use in this function)
hostapd.c: In function `hostapd_wpa_auth_get_seqnum':
hostapd.c:942: error: dereferencing pointer to incomplete type
hostapd.c: In function `hostapd_wpa_auth_get_seqnum_igtk':
hostapd.c:950: error: dereferencing pointer to incomplete type
hostapd.c: At top level:
hostapd.c:956: error: parse error before "size_t"
。。。
hostapd.c:1619: error: dereferencing pointer to incomplete type
hostapd.c:1621: error: dereferencing pointer to incomplete type
hostapd.c:1622: error: dereferencing pointer to incomplete type
hostapd.c:1628: error: dereferencing pointer to incomplete type
。。。
hostapd.c:1798: error: dereferencing pointer to incomplete type
hostapd.c: In function `hostapd_init':
hostapd.c:1825: error: `size_t' undeclared (first use in this function)
hostapd.c:1825: error: parse error before "i"
。。。
hostapd.c:1860: error: dereferencing pointer to incomplete type
hostapd.c:1860: error: dereferencing pointer to incomplete type
hostapd.c:1861: error: dereferencing pointer to incomplete type
hostapd.c:1866: error: dereferencing pointer to incomplete type
hostapd.c:1867: error: dereferencing pointer to incomplete type
hostapd.c: In function `main':
hostapd.c:1876: error: storage size of 'interfaces' isn't known
hostapd.c:1878: error: `size_t' undeclared (first use in this function)
hostapd.c:1878: error: parse error before "i"
hostapd.c:1944: error: `SIGHUP' undeclared (first use in this function)
hostapd.c:1945: error: `SIGUSR1' undeclared (first use in this function)
hostapd.c:1950: error: `i' undeclared (first use in this function)
hostapd.c:1993: error: `j' undeclared (first use in this function)
hostapd.c:1876: warning: unused variable `interfaces'
hostapd.c: At top level:
/ap/ixp425/snapgear/uClibc/include/netinet/in.h:228: error: storage size of `sin_zero' isn't known
config.h:69: error: storage size of `wep' isn't known
eapol_sm.h:225: error: storage size of `radius_class' isn't known
make: *** [hostapd.o] 错误 1
我分析了一下错误,错误大致分为三类,一些数据结构未定义,size_t未定义,还有就是error: dereferencing pointer to incomplete type。
我看了源码,size_t是头文件stddef.h内定义的,数据结构定义的类型都是size_t,所以前两个问题基本可以归为一个,
下面的就不是很清楚了,stddef.h也没有说找不到,这是不是预编译的问题啊?我应该如何修改呢?还有后面的一个问题,希望高手能给指点一下。
|
既然编译通过了,我建议暂时不要去修改编译过程。
用arm-linux-readelf -d看看你的程序依赖哪些库。
然后检查目标板子上有没有这些库。
不能运行的程序报什么错误?
用arm-linux-readelf -d看看你的程序依赖哪些库。
然后检查目标板子上有没有这些库。
不能运行的程序报什么错误?
|
hello word也是报这个错误吗?
感觉有点象大小端的问题。
|
我很少用QQ的,一般在MSN上:richard.yangmrs@mic.com.tw
您可能感兴趣的文章:
本站(WWW.)旨在分享和传播互联网科技相关的资讯和技术,将尽最大努力为读者提供更好的信息聚合和浏览方式。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。
本站(WWW.)站内文章除注明原创外,均为转载、整理或搜集自网络。欢迎任何形式的转载,转载请注明出处。