Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
20 years ago

Error when compiling application for ethernet

Hi All,

I am trying to develop an application for ethernet device. I am using open core device driver which comes with uCLinux.

To open an ethernet device i need to get a structure named net_device which is defined into netdevice.h. After including file netdevice.h and compiling application there are following errors displayed.

In file included from

D:/TOOLS/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/netdevice.h:28,

from test.c:3:

D:/TOOLS/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/if.h:136: error: field `ifru_addr' has incomplete type

D:/TOOLS/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/if.h:137: error: field `ifru_dstaddr' has incomplete type

D:/TOOLS/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/if.h:138: error: field `ifru_broadaddr' has incomplete type

D:/TOOLS/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/if.h:139: error: field `ifru_netmask' has incomplete type

D:/TOOLS/altera/kits/nios2/bin/eclipse/plugins/com.microtronix.nios2linux.uClibc_0.1.0/include/linux/if.h:140: error: field `ifru_hwaddr' has incomplete type

test.c:6: warning: return type defaults to `int'

test.c: In function `main':

test.c:9: error: storage size of `dev' isn't known

test.c:14: warning: implicit declaration of function `write'

test.c:9: warning: unused variable `dev'

test.c:16:2: warning: no newline at end of file

make: *** [test.o] Error 1

make: Target `all' not remade because of errors.

Here is the part of my application code..

# include<stdio.h># include<fcntl.h># include<linux/netdevice.h>

main()

{

int i,j=0;

const char* buf="hello";

struct net_device dev;

}

Can anybody suggest anything for this? Thanks in advance.
No RepliesBe the first to reply