- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I tried to use the dhcp_set_hostname() function but the linker complained that it couldn't find that function. I used it in a file that is compiled as C++. I found that the solution was to edit the dhcp.h file provided with ecos to change this code:
// Set hostname to be used with the DHCP TAG_HOST_NAME option. // Call this before calling init_all_network_interfaces() to // set the hostname value.# ifdef CYGOPT_NET_DHCP_OPTION_HOST_NAME extern void dhcp_set_hostname(char *hostname); # else# define dhcp_set_hostname(hostname) CYG_EMPTY_STATEMENT# endif into this: // Set hostname to be used with the DHCP TAG_HOST_NAME option. // Call this before calling init_all_network_interfaces() to // set the hostname value.# ifdef CYGOPT_NET_DHCP_OPTION_HOST_NAME externC void dhcp_set_hostname(char *hostname); # else# define dhcp_set_hostname(hostname) CYG_EMPTY_STATEMENT# endif The difference is that I changed extern to externC. I'd rather not edit the ecos source code, so is there another way I could make this work? MikeLink Copied
0 Replies

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page