Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12600 Discussions

Error when compiling application for ethernet

Altera_Forum
Honored Contributor II
944 Views

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.
0 Kudos
0 Replies
Reply