AW: AW: [En-Nut-Discussion] compile problem in ethernut 4.x ?

Ing. Joachim Skale joachim.skale at tele2.at
Fri Feb 3 11:08:08 CET 2006


okay, i'm blind on friday. :-)

-----Ursprüngliche Nachricht-----
Von: en-nut-discussion-bounces at egnite.de
[mailto:en-nut-discussion-bounces at egnite.de]Im Auftrag von Ulrich
Hertlein
Gesendet: Freitag, 03. Februar 2006 11:05
An: Ethernut User Chat (English)
Betreff: Re: AW: [En-Nut-Discussion] compile problem in ethernut 4.x ?


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
_______________________________________________
En-Nut-Discussion mailing list
En-Nut-Discussion at egnite.de
http://www.egnite.de/mailman/listinfo.cgi/en-nut-discussion




More information about the En-Nut-Discussion mailing list