Gentoo Archives: gentoo-user

From: Meino Christian Cramer <Meino.Cramer@×××.de>
To: gentoo-user@l.g.o, bo.andresen@××××.dk
Subject: Re: [gentoo-user] What is that (compile errors in system headers...)
Date: Mon, 02 Oct 2006 18:20:35
Message-Id: 20061002.201503.71088862.Meino.Cramer@gmx.de
In Reply to: Re: [gentoo-user] What is that (compile errors in system headers...) by "Bo Ørsted Andresen"
1 From: Bo Ørsted Andresen <bo.andresen@××××.dk>
2 Subject: Re: [gentoo-user] What is that (compile errors in system headers...)
3 Date: Mon, 2 Oct 2006 19:58:57 +0200
4
5 > On Monday 02 October 2006 19:48, Meino Christian Cramer wrote:
6 > > I tried to compile a little program (nothing special) and got this
7 > > errors:
8 > >
9 > > In file included from /usr/include/stdlib.h:438,
10 > > from ethlinkstat.c:10:
11 > > /usr/include/sys/types.h:62: error: conflicting types for 'dev_t'
12 > > /usr/include/linux/types.h:27: error: previous declaration of 'dev_t'
13 > [SNIP]
14 > > What should I do here ?
15 >
16 > Bug #144205 [1] should be of interest here. Basically you need to include
17 > <sys/types.h> before <linux/types.h>.
18 >
19 > [1] https://bugs.gentoo.org/show_bug.cgi?id=144205
20 >
21 > --
22 > Bo Andresen
23
24 Hi Bo,
25
26 thanks for your fast reply, but unfortunately it does not completely
27 solve it. Now I get this:
28
29 In file included from /usr/include/stdlib.h:438,
30 from ethlinkstat.c:10:
31 /usr/include/sys/types.h:62: error: conflicting types for 'dev_t'
32 /usr/include/linux/types.h:27: error: previous declaration of 'dev_t' was here
33 /usr/include/sys/types.h:72: error: conflicting types for 'mode_t'
34 /usr/include/linux/types.h:33: error: previous declaration of 'mode_t' was here
35 /usr/include/sys/types.h:77: error: conflicting types for 'nlink_t'
36 /usr/include/linux/types.h:36: error: previous declaration of 'nlink_t' was here
37 In file included from /usr/include/sys/types.h:133,
38 from /usr/include/stdlib.h:438,
39 from ethlinkstat.c:10:
40 /usr/include/time.h:105: error: conflicting types for 'timer_t'
41 /usr/include/linux/types.h:45: error: previous declaration of 'timer_t' was here
42 In file included from /usr/include/sys/types.h:220,
43 from /usr/include/stdlib.h:438,
44 from ethlinkstat.c:10:
45 /usr/include/sys/select.h:78: error: conflicting types for 'fd_set'
46 /usr/include/linux/types.h:24: error: previous declaration of 'fd_set' was here
47 In file included from /usr/include/stdlib.h:438,
48 from ethlinkstat.c:10:
49 /usr/include/sys/types.h:235: error: conflicting types for 'blkcnt_t'
50 /usr/include/linux/types.h:158: error: previous declaration of 'blkcnt_t' was here
51 In file included from /usr/include/sys/uio.h:29,
52 from /usr/include/sys/socket.h:27,
53 from ethlinkstat.c:15:
54 /usr/include/bits/uio.h:43: error: redefinition of 'struct iovec'
55 In file included from /usr/include/sys/socket.h:35,
56 from ethlinkstat.c:15:
57 /usr/include/bits/socket.h:146: error: redefinition of 'struct sockaddr'
58 /usr/include/bits/socket.h:163: error: redefinition of 'struct __kernel_sockaddr_storage'
59 /usr/include/bits/socket.h:173: error: expected identifier before numeric constant
60 /usr/include/bits/socket.h:216: error: redefinition of 'struct msghdr'
61 /usr/include/bits/socket.h:231: error: redefinition of 'struct cmsghdr'
62 /usr/include/bits/socket.h:258: error: conflicting types for '__cmsg_nxthdr'
63 /usr/include/linux/socket.h:136: error: previous definition of '__cmsg_nxthdr' was here
64 /usr/include/bits/socket.h:286: error: expected identifier before numeric constant
65 /usr/include/bits/socket.h:297: error: redefinition of 'struct ucred'
66 /usr/include/bits/socket.h:309: error: redefinition of 'struct linger'
67
68
69 Something seems to be rotten in my system...
70 May be the linux kernel header files under /usr/linux and those of
71 linux-2.6.18 are incompatible ???
72
73 My includes are now:
74
75 #include <linux/if.h>
76 #include <linux/ethtool.h>
77 #include <stdio.h>
78 #include <stdlib.h>
79 #include <string.h>
80 #include <errno.h>
81 #include <sys/types.h>
82 #include <linux/types.h>
83 #include <sys/socket.h>
84
85 The program (a eth-link tester) is simply compiled with
86
87 make <program>
88
89 and I compile with gcc-4.1.1 (yse I did all the emerge system/world
90 thingies and beside of this everything works fine until
91 now). Compiling the kernel is as boring as ever ;O)
92
93
94 Keep hacking!
95 mcc
96
97
98
99
100 --
101 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] What is that (compile errors in system headers...) "Bo Ørsted Andresen" <bo.andresen@××××.dk>