| 
 
| 本帖最后由 wlawei 于 2016-3-20 17:14 编辑 
 大家好,刚开始学STM32+lwip
 编译的时候碰到一下错误
 ..\OBJ\LWip.axf: Error: L6218E: Undefined symbol dns_gethostbyname (referred from tcp_client_demo.o).
 
 dns_gethostbyname是在dns.c的一个函数,可是,我已经include,为什么还是报错?
 ////////////////////////代码如下////////////////////////////
 #include "lwip/tcp.h"
 #include <string.h>
 #include <math.h>
 //#include "led.h"
 #include "tcp_client_demo.h"
 //#include "lwip/ip_addr.h"
 #include "lwip/dns.h"
 
 
 
 ip_addr_t myIP;                        //域名解析后的IP
 
 static void my_found(const char *name, ip_addr_t *ipaddr, void *arg)
 {
 u8_t ip[4];
 myIP = *ipaddr;//保存IP,并在后续打印到串口
 
 
 }
 
 void        MyDNS(void)
 {
 char hostname[]="www.yeelink.net";//需要解析的域名
 ip_addr_t        addr;                                                                                //记录IP
 dns_gethostbyname(hostname,addr,my_found,NULL);
 }
 里面的乱码都是中文注释,贴过来就是这样,不再改了
 
 接收aozima的建议,把注释都打上了
 
 | 
 |