AW: [En-Nut-Discussion] compile problem in ethernut 4.x ?
Ulrich Hertlein
ulrich.hertlein at artcom.de
Fri Feb 3 11:04:49 CET 2006
Ing. Joachim Skale wrote:
> if i'm not totally blind,
> there aren't any differences.
I had a hard time spotting the changes as well. He commented out the 'if
(NutDhcpIfConfig...)' condition so the inner block is executed always.
Some (C) compilers insist on having the variables declared at the
beginning of a block *only*. Could it be that this is confusing the
compiler?
Maybe you could just write
<code>
{
u_char mac[] = { MYMAC };
u_long ip_addr = inet_addr(MYIP);
u_long ip_mask = inet_addr(MYMASK);
puts("EEPROM/DHCP/ARP config failed");
NutNetIfConfig("eth0", mac, ip_addr, ip_mask);
}
</code>
OTOH the errors seem to be more linker than compiler related.
/Ulrich
> I try to compile exsamle in ethernut 4.0.1 "httpd" with winavr-20050214
>...
> convert to:
>
> /*
> * LAN configuration using EEPROM values or DHCP/ARP method.
> * If it fails, use fixed values.
> */
> // if (NutDhcpIfConfig("eth0", 0, 60000)) {
> u_char mac[] = { MYMAC };
> u_long ip_addr = inet_addr(MYIP);
> u_long ip_mask = inet_addr(MYMASK);
>
> puts("EEPROM/DHCP/ARP config failed");
> NutNetIfConfig("eth0", mac, ip_addr, ip_mask);
> // }
--
Ulrich Hertlein | Software Development
ART+COM AG
Kleiststr. 23-26 | 10787 Berlin | Germany
phone: +49.30.21001-433
fax: +49.30.21001-555
http://www.artcom.de
More information about the En-Nut-Discussion
mailing list