为了验证SIMcom的3G模块在linux能实现拨号上网,所以要用到pppd拨号程序,但是使用过程中遇到如下问题:
本文:http://blog.youkuaiyun.com/code_style/article/details/52402072
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可执行程序,但放到板子上运行之后,总是出现如下的错误。
总是报错:
<span style="font-size:14px;"> # pppd
pppd: can't resolve symbol '__ctype_b_loc'
~ # pppd --help
pppd: can't resolve symbol '__ctype_b_loc'
~ #</span>4、__ctype_b_loc这个symbol到底是什么东西?
原来,代码有问题,把所有ppp-2.4.7/pppd目录下的源代码里面的#include <ctype.h>注释掉,重新编译,出来的pppd就可以完美运行了,chat源代码也按照pppd的方法如法炮制。
5、好,完美运行了,一点错误也没有
pppd version 2.4.7
Usage: pppd [ options ], where options are:
<device> Communicate over the named device
<speed> Set the baud rate to <speed>
<loc>:<rem> Set the local and/or remote interface IP
addresses. Either one may be omitted.
asyncmap <n> Set the desired async map to hex <n>
auth Require authentication from peer
connect <p> Invoke shell command <p> to set up the serial line
crtscts Use hardware RTS/CTS flow control
defaultroute Add default route through interface
file <f> Take options from file <f>
modem Use modem control lines
mru <n> Set MRU value to <n> for negotiation
See pppd(8) for more options
本文介绍了如何在嵌入式Linux环境下编译pppd及chat程序,并解决了编译后程序无法运行的问题。通过调整源代码中的ctype.h包含问题,最终使pppd能够成功运行并实现拨号上网。
1023

被折叠的 条评论
为什么被折叠?



