| | |
Error Message "Redifinition of `Struct ...'
Please support our C advertiser: Programming Forums - DaniWeb Sister Site
![]() |
Help!
Now I study about NAT (Network Address Translator), it is a new way about translate IP local to public.
Ok, the point is when I want to install NAT in LINUX, i got error messages like below. I think this is about coding in nat.h. What should I do with the redefinition error?
Thank you for help me.
========================================================
-bash-3.00$ make
making all in nat...
make[1]: Entering directory `/home/petry/Netbench/NetBench-1.1.0/nat'
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c route.c
In file included from route.c:95:
nat.h:165: redefinition of `struct ifnet'
nat.h:174: redefinition of `struct ifqueue'
make[1]: *** [route.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
========================================================
Now I study about NAT (Network Address Translator), it is a new way about translate IP local to public.
Ok, the point is when I want to install NAT in LINUX, i got error messages like below. I think this is about coding in nat.h. What should I do with the redefinition error?
Thank you for help me.
========================================================
-bash-3.00$ make
making all in nat...
make[1]: Entering directory `/home/petry/Netbench/NetBench-1.1.0/nat'
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c route.c
In file included from route.c:95:
nat.h:165: redefinition of `struct ifnet'
nat.h:174: redefinition of `struct ifqueue'
make[1]: *** [route.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
========================================================
•
•
Join Date: Nov 2007
Posts: 18
Reputation:
Solved Threads: 0
•
•
•
•
Help!
Now I study about NAT (Network Address Translator), it is a new way about translate IP local to public.
Ok, the point is when I want to install NAT in LINUX, i got error messages like below. I think this is about coding in nat.h. What should I do with the redefinition error?
Thank you for help me.![]()
========================================================
-bash-3.00$ make
making all in nat...
make[1]: Entering directory `/home/petry/Netbench/NetBench-1.1.0/nat'
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c route.c
In file included from route.c:95:
nat.h:165: redefinition of `struct ifnet'
nat.h:174: redefinition of `struct ifqueue'
make[1]: *** [route.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
========================================================
hi..
First check whether you have declared structs more than 1 time or not.
To check open a terminal and go to the directory containing the source code, using cd command and than execute command
grep -rin "struct ifnet" .
This will list all the lines which contains above structure than u can trace its multiple declaration or definition.
Thanks for the advice. I've tried the solutions but still have errors.
The last time I did that I remark the struct. And I got the error message like this.
==========================================================
-bash-3.00$ make
making all in nat...
make[1]: Entering directory `/home/petry/Netbench/NetBench-1.1.0/nat'
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c route.c
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c radix.c
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c nat.c
nat.c:73: sys/protosw.h: No such file or directory
nat.c:81: sys/mbuf.h: No such file or directory
nat.c:108: netinet/ip.h: No such file or directory
In file included from nat.c:116:
nat.h:108: warning: `FWRITE' redefined
/home/petry/simple//sslittle-na-sstrix/include/fcntlbits.h:59: warning: this is the location of the previous definition
nat.h:109: warning: `FREAD' redefined
/home/petry/simple//sslittle-na-sstrix/include/fcntlbits.h:58: warning: this is the location of the previous definition
nat.c:124: netinet/ip_var.h: No such file or directory
nat.c:127: netinet/tcp.h: No such file or directory
nat.c:128: netinet/udp.h: No such file or directory
nat.c:129: netinet/ip_icmp.h: No such file or directory
make[1]: *** [nat.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
The last time I did that I remark the struct. And I got the error message like this.
==========================================================
-bash-3.00$ make
making all in nat...
make[1]: Entering directory `/home/petry/Netbench/NetBench-1.1.0/nat'
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c route.c
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c radix.c
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c nat.c
nat.c:73: sys/protosw.h: No such file or directory
nat.c:81: sys/mbuf.h: No such file or directory
nat.c:108: netinet/ip.h: No such file or directory
In file included from nat.c:116:
nat.h:108: warning: `FWRITE' redefined
/home/petry/simple//sslittle-na-sstrix/include/fcntlbits.h:59: warning: this is the location of the previous definition
nat.h:109: warning: `FREAD' redefined
/home/petry/simple//sslittle-na-sstrix/include/fcntlbits.h:58: warning: this is the location of the previous definition
nat.c:124: netinet/ip_var.h: No such file or directory
nat.c:127: netinet/tcp.h: No such file or directory
nat.c:128: netinet/udp.h: No such file or directory
nat.c:129: netinet/ip_icmp.h: No such file or directory
make[1]: *** [nat.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
•
•
Join Date: Nov 2007
Posts: 18
Reputation:
Solved Threads: 0
•
•
•
•
Thanks for the advice. I've tried the solutions but still have errors.
The last time I did that I remark the struct. And I got the error message like this.
==========================================================
-bash-3.00$ make
making all in nat...
make[1]: Entering directory `/home/petry/Netbench/NetBench-1.1.0/nat'
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c route.c
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c radix.c
/home/petry/simple/bin/sslittle-na-sstrix-gcc -Wall -DDEBUG -DCONSTANT_PACKET -I/home/petry/Netbench/NetBench-1.1.0/include -DMAX_PACKETS=10 -c nat.c
nat.c:73: sys/protosw.h: No such file or directory
nat.c:81: sys/mbuf.h: No such file or directory
nat.c:108: netinet/ip.h: No such file or directory
In file included from nat.c:116:
nat.h:108: warning: `FWRITE' redefined
/home/petry/simple//sslittle-na-sstrix/include/fcntlbits.h:59: warning: this is the location of the previous definition
nat.h:109: warning: `FREAD' redefined
/home/petry/simple//sslittle-na-sstrix/include/fcntlbits.h:58: warning: this is the location of the previous definition
nat.c:124: netinet/ip_var.h: No such file or directory
nat.c:127: netinet/tcp.h: No such file or directory
nat.c:128: netinet/udp.h: No such file or directory
nat.c:129: netinet/ip_icmp.h: No such file or directory
make[1]: *** [nat.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
eg: Header files are somewhere in path /opt/ipp/include
than u can specify the path at the time of compilation or in makefile using option -I as shown below.
gcc myprog.c -I/opt/ipp/include
where myprog.c is my program to be compiled and the header files required by it are present in apth /opt/ipp/include.
•
•
Join Date: Nov 2007
Posts: 18
Reputation:
Solved Threads: 0
Check what has been assigned to varialbe NETINCLUDE and what is the actual path of the header files included in .c file? Are they same?
Dear varsha0702,
I've copy file that needed in the appropriate folder. Then, fix another error after copy those files. But, now I got strange error. This error comes from the main program of nat, that is nat.c. If I compile with gcc from Linux, nothing problem with this nat.c. But, now I want to compile the nat.c with gcc from SimpleScalar, and got this error. Here's some errors :
=======================================================
nat.c:1787: invalid type argument of `->'
nat.c:1790: invalid type argument of `->'
nat.c:1791: invalid type argument of `->'
nat.c:1793: invalid type argument of `->'
nat.c:1794: invalid type argument of `->'
nat.c:1795: invalid type argument of `->'
nat.c:1796: invalid type argument of `->'
nat.c:1797: invalid type argument of `->'
nat.c:1798: invalid type argument of `->'
nat.c:1807: `msk' undeclared (first use this function)
nat.c:1810: `iph' undeclared (first use this function)
nat.c:1831: warning: assignment makes integer from pointer without a cast
nat.c:1852: invalid type argument of `->'
nat.c:1853: invalid type argument of `->'
nat.c:1855: invalid type argument of `->'
nat.c:1856: invalid type argument of `->'
nat.c:1857: invalid type argument of `->'
nat.c:1874: invalid type argument of `->'
nat.c:1875: invalid type argument of `->'
nat.c:1880: `csump' undeclared (first use this function)
nat.c:1889: invalid type argument of `->'
nat.c:1889: `TCP_CLOSE' undeclared (first use this function)
nat.c:1890: invalid type argument of `->'
nat.c:1890: `TCP_LAST_ACK' undeclared (first use this function)
nat.c:1893: `udphdr_t' undeclared (first use this function)
nat.c:1893: `udp' undeclared (first use this function)
nat.c:1893: parse error before `)'
nat.c:1899: invalid type argument of `->'
nat.c:1900: invalid type argument of `->'
nat.c:1903: invalid type argument of `->'
nat.c: At top level:
nat.c:1212: warning: `nat_delnat' defined but not used
make[1]: *** [nat.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
======================================================
Anyone can help me?.. Thank you
I've copy file that needed in the appropriate folder. Then, fix another error after copy those files. But, now I got strange error. This error comes from the main program of nat, that is nat.c. If I compile with gcc from Linux, nothing problem with this nat.c. But, now I want to compile the nat.c with gcc from SimpleScalar, and got this error. Here's some errors :
=======================================================
nat.c:1787: invalid type argument of `->'
nat.c:1790: invalid type argument of `->'
nat.c:1791: invalid type argument of `->'
nat.c:1793: invalid type argument of `->'
nat.c:1794: invalid type argument of `->'
nat.c:1795: invalid type argument of `->'
nat.c:1796: invalid type argument of `->'
nat.c:1797: invalid type argument of `->'
nat.c:1798: invalid type argument of `->'
nat.c:1807: `msk' undeclared (first use this function)
nat.c:1810: `iph' undeclared (first use this function)
nat.c:1831: warning: assignment makes integer from pointer without a cast
nat.c:1852: invalid type argument of `->'
nat.c:1853: invalid type argument of `->'
nat.c:1855: invalid type argument of `->'
nat.c:1856: invalid type argument of `->'
nat.c:1857: invalid type argument of `->'
nat.c:1874: invalid type argument of `->'
nat.c:1875: invalid type argument of `->'
nat.c:1880: `csump' undeclared (first use this function)
nat.c:1889: invalid type argument of `->'
nat.c:1889: `TCP_CLOSE' undeclared (first use this function)
nat.c:1890: invalid type argument of `->'
nat.c:1890: `TCP_LAST_ACK' undeclared (first use this function)
nat.c:1893: `udphdr_t' undeclared (first use this function)
nat.c:1893: `udp' undeclared (first use this function)
nat.c:1893: parse error before `)'
nat.c:1899: invalid type argument of `->'
nat.c:1900: invalid type argument of `->'
nat.c:1903: invalid type argument of `->'
nat.c: At top level:
nat.c:1212: warning: `nat_delnat' defined but not used
make[1]: *** [nat.o] Error 1
make[1]: Leaving directory `/home/petry/Netbench/NetBench-1.1.0/nat'
make: *** [sub_all] Error 1
======================================================
Anyone can help me?.. Thank you
![]() |
Other Threads in the C Forum
- Previous Thread: Recursion Question. If anyone Can help me
- Next Thread: how to find maximum value in linked list ?? please help.
| Thread Tools | Search this Thread |
adobe ansi api array arrays asterisks binarysearch calculate centimeter char convert copyimagefile copypdffile cprogramme creafecopyofanytypeoffileinc createcopyoffile csyntax directory dynamic fflush file fork forloop frequency getlasterror givemetehcodez graphics gtkgcurlcompiling hacking hardware highest homework i/o inches incrementoperators infiniteloop initialization interest kernel km linked linkedlist linux linuxsegmentationfault list lists locate logical_drives match matrix microsoft motherboard multi mysql number open opendocumentformat opensource owf pattern pdf performance pointer pointers posix power problem probleminc program programming pyramidusingturboccodes radix read recursion recv repetition research scanf scheduling scripting segmentationfault send sequential shape socketprograming stack standard string strings structures systemcall testautomation turboc unix user variable voidmain() wab win32api windows.h





