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

def at fea.kiev.ua def at fea.kiev.ua
Fri Feb 3 12:54:13 CET 2006


On Fri, February 3, 2006 12:04 pm, Ulrich Hertlein wrote:
> 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.
>
>
No... 8(
Beacose whene I use:
    NutDhcpIfConfig("eth0", 0, 0);
    u_char mac[] = { MYMAC };
    u_long ip_addr = inet_addr(MYIP);
    u_long ip_mask = inet_addr(MYMASK);

    NutNetIfConfig("eth0", mac, ip_addr, ip_mask);
all compiles well.
But if comment NutDhcpIfConfig("eth0", 0, 0); then get same linker errors 8(
8(


> /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