[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lwip-users] Re: Problem on using DNS function in app

From: Bei Guan
Subject: [lwip-users] Re: Problem on using DNS function in app
Date: Thu, 18 Nov 2010 23:25:52 +0800

Now I can compile successfully. But there are some error and the value of the error is -9, which means "Illegal value".

My code:
char hname[]="www.baidu.com";
struct ip_addr addr;
err_t err;
if ((err = netconn_gethostbyname((char*)(hname), &(addr))) == ERR_OK) {
   printf("netconn_gethostbyname(%s)==", (char*)(hname));
   ip_addr_debug_print(LWIP_DBG_ON, (&addr));
} else {
   printf("netconn_gethostbyname(%s)==%i\n", (char*)(hname), (int)(err));

And the output:

So why the DNS can not work?

Bei Guan

2010/11/18 Bei Guan <address@hidden>
Hi all,

I have used the function netconn_gethostbyname in my program. I have set the #define LWIP_DNS 1 in lwipopts.h and I also have include the "lwip/api.h" before my main function. When I compile my program, it came cross an error message: undefined reference to `netconn_gethostbyname'. But some other function can be used successfully, such as netconn_connect.

So anyone can give me advice. Thanks a lot!

Bei Guan

reply via email to

[Prev in Thread] Current Thread [Next in Thread]