1、编译ppp-2.4.7.tar.gz,针对嵌入式linux平台;
2、按照网上的方法无非是如下:
1) 把ppp的源码解开
tar zxvf ppp-2.4.5.tar.gz
2) 进入ppp-2.4.5/pppd目录
修改Makefile.linux
设置 CC = /usr/local/arm/3.4.1/bin/arm-linux-gcc
3) make -f Makefile.linux 即可编译出pppd
4) 同样进入ppp-2.4.5/chat目录, 并设置
CC=/usr/local/arm/3.4.1/bin/arm-linux-gcc
5) make -f Makefile.linux 即可编译出chat
3、按照上面的方法编译出来的pppd可执行程序,但放到板子上运行之后,总是出现如下的错误。
总是报错:
1 2 3 4 5 6 | <span style="font-size: 14px;"> # pppd pppd: can't resolve symbol '__ctype_b_loc'</span> ~ # pppd --help pppd: can't resolve symbol '__ctype_b_loc' ~ # |
4、__ctype_b_loc这个symbol到底是什么东西?
原来,代码有问题,把所有ppp-2.4.7/pppd目录下的源代码里面的#include <ctype.h>注释掉,重新编译,出来的pppd就可以完美运行了,chat源代码也按照pppd的方法如法炮制。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | /usr/sbin # pppd --help pppd version 2.4.7 Usage: pppd [ options ], where options are: Communicate over the named device Set the baud rate to : Set the local and/or remote interface IP addresses. Either one may be omitted. asyncmap Set the desired async map to hex auth Require authentication from peer connect Invoke shell command to set up the serial line crtscts Use hardware RTS/CTS flow control defaultroute Add default route through interface file Take options from file modem Use modem control lines mru Set MRU value to for negotiation See pppd(8) for more options |

老D博客 微信公众号
请大佬们关注订阅老D博客微信公众号, 扫一扫关注,从此不迷路。 不定时放出邀请码、福利、推送更新等...