Compiling Genesis-2.3 on Ubuntu 9.0.4 fails with the following messages:
In file included from /usr/include/unistd.h:1112,
from sim_notes.c:54:
/usr/include/bits/unistd.h: In function ‘GetHeader’:
/usr/include/bits/unistd.h:36: error: nested function ‘read’ declared ‘extern’
/usr/include/bits/unistd.h:35: error: static declaration of ‘read’ follows non-static declaration
/usr/include/unistd.h:327: error: previous declaration of ‘read’ was here
/usr/include/bits/unistd.h:142: error: nested function ‘readlink’ declared ‘extern’
/usr/include/bits/unistd.h:140: error: static declaration of ‘readlink’ follows non-static declaration
/usr/include/unistd.h:787: error: previous declaration of ‘readlink’ was here
/usr/include/bits/unistd.h:202: error: nested function ‘getcwd’ declared ‘extern’
/usr/include/bits/unistd.h:201: error: static declaration of ‘getcwd’ follows non-static declaration
/usr/include/unistd.h:477: error: previous declaration of ‘getcwd’ was here
/usr/include/bits/unistd.h:223: error: nested function ‘getwd’ declared ‘extern’
/usr/include/bits/unistd.h:222: error: static declaration of ‘getwd’ follows non-static declaration
/usr/include/unistd.h:490: error: previous declaration of ‘getwd’ was here
/usr/include/bits/unistd.h:242: error: nested function ‘confstr’ declared ‘extern’
/usr/include/bits/unistd.h:241: error: static declaration of ‘confstr’ follows non-static declaration
/usr/include/unistd.h:580: error: previous declaration of ‘confstr’ was here
/usr/include/bits/unistd.h:267: error: nested function ‘getgroups’ declared ‘extern’
/usr/include/bits/unistd.h:266: error: static declaration of ‘getgroups’ follows non-static declaration
/usr/include/unistd.h:668: error: previous declaration of ‘getgroups’ was here
/usr/include/bits/unistd.h:293: error: nested function ‘ttyname_r’ declared ‘extern’
/usr/include/bits/unistd.h:292: error: static declaration of ‘ttyname_r’ follows non-static declaration
/usr/include/unistd.h:752: error: previous declaration of ‘ttyname_r’ was here
/usr/include/bits/unistd.h:319: error: nested function ‘getlogin_r’ declared ‘extern’
/usr/include/bits/unistd.h:318: error: static declaration of ‘getlogin_r’ follows non-static declaration
/usr/include/unistd.h:835: error: previous declaration of ‘getlogin_r’ was here
/usr/include/bits/unistd.h:346: error: nested function ‘gethostname’ declared ‘extern’
/usr/include/bits/unistd.h:345: error: static declaration of ‘gethostname’ follows non-static declaration
/usr/include/unistd.h:857: error: previous declaration of ‘gethostname’ was here
/usr/include/bits/unistd.h:375: error: nested function ‘getdomainname’ declared ‘extern’
/usr/include/bits/unistd.h:374: error: static declaration of ‘getdomainname’ follows non-static declaration
/usr/include/unistd.h:875: error: previous declaration of ‘getdomainname’ was here
make: *** Error 1
To fix the above, I did a small hack. I commented out the following line in the file sim_notes.c.
Line 54: #include <unistd.h>
I am not sure why the above hack works but it compiles successfully after this hack. If anyone can shed more light on this, I'd appreciate it.
cheers,
Kartik
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Compiling Genesis-2.3 on Ubuntu 9.0.4 fails with the following messages:
In file included from /usr/include/unistd.h:1112,
from sim_notes.c:54:
/usr/include/bits/unistd.h: In function ‘GetHeader’:
/usr/include/bits/unistd.h:36: error: nested function ‘read’ declared ‘extern’
/usr/include/bits/unistd.h:35: error: static declaration of ‘read’ follows non-static declaration
/usr/include/unistd.h:327: error: previous declaration of ‘read’ was here
/usr/include/bits/unistd.h:142: error: nested function ‘readlink’ declared ‘extern’
/usr/include/bits/unistd.h:140: error: static declaration of ‘readlink’ follows non-static declaration
/usr/include/unistd.h:787: error: previous declaration of ‘readlink’ was here
/usr/include/bits/unistd.h:202: error: nested function ‘getcwd’ declared ‘extern’
/usr/include/bits/unistd.h:201: error: static declaration of ‘getcwd’ follows non-static declaration
/usr/include/unistd.h:477: error: previous declaration of ‘getcwd’ was here
/usr/include/bits/unistd.h:223: error: nested function ‘getwd’ declared ‘extern’
/usr/include/bits/unistd.h:222: error: static declaration of ‘getwd’ follows non-static declaration
/usr/include/unistd.h:490: error: previous declaration of ‘getwd’ was here
/usr/include/bits/unistd.h:242: error: nested function ‘confstr’ declared ‘extern’
/usr/include/bits/unistd.h:241: error: static declaration of ‘confstr’ follows non-static declaration
/usr/include/unistd.h:580: error: previous declaration of ‘confstr’ was here
/usr/include/bits/unistd.h:267: error: nested function ‘getgroups’ declared ‘extern’
/usr/include/bits/unistd.h:266: error: static declaration of ‘getgroups’ follows non-static declaration
/usr/include/unistd.h:668: error: previous declaration of ‘getgroups’ was here
/usr/include/bits/unistd.h:293: error: nested function ‘ttyname_r’ declared ‘extern’
/usr/include/bits/unistd.h:292: error: static declaration of ‘ttyname_r’ follows non-static declaration
/usr/include/unistd.h:752: error: previous declaration of ‘ttyname_r’ was here
/usr/include/bits/unistd.h:319: error: nested function ‘getlogin_r’ declared ‘extern’
/usr/include/bits/unistd.h:318: error: static declaration of ‘getlogin_r’ follows non-static declaration
/usr/include/unistd.h:835: error: previous declaration of ‘getlogin_r’ was here
/usr/include/bits/unistd.h:346: error: nested function ‘gethostname’ declared ‘extern’
/usr/include/bits/unistd.h:345: error: static declaration of ‘gethostname’ follows non-static declaration
/usr/include/unistd.h:857: error: previous declaration of ‘gethostname’ was here
/usr/include/bits/unistd.h:375: error: nested function ‘getdomainname’ declared ‘extern’
/usr/include/bits/unistd.h:374: error: static declaration of ‘getdomainname’ follows non-static declaration
/usr/include/unistd.h:875: error: previous declaration of ‘getdomainname’ was here
make: *** Error 1
To fix the above, I did a small hack. I commented out the following line in the file sim_notes.c.
Line 54: #include <unistd.h>
I am not sure why the above hack works but it compiles successfully after this hack. If anyone can shed more light on this, I'd appreciate it.
cheers,
Kartik