walkie

Compile error

0
阅读(2602)

These dyas i found a very strange error as followsing shows:

gcc -g    -c -o selftest_dma.o selftest_dma.c
In file included from selftest_dma.c:3:
/usr/include/sys/types.h:62: error: conflicting types for ‘dev_t’
/usr/include/linux/types.h:13: error: previous declaration of ‘dev_t’ was here
/usr/include/sys/types.h:67: error: conflicting types for ‘gid_t’
/usr/include/linux/types.h:27: error: previous declaration of ‘gid_t’ was here
/usr/include/sys/types.h:72: error: conflicting types for ‘mode_t’
/usr/include/linux/types.h:15: error: previous declaration of ‘mode_t’ was here
/usr/include/sys/types.h:77: error: conflicting types for ‘nlink_t’
/usr/include/linux/types.h:16: error: previous declaration of ‘nlink_t’ was here
/usr/include/sys/types.h:82: error: conflicting types for ‘uid_t’
/usr/include/linux/types.h:26: error: previous declaration of ‘uid_t’ was here
In file included from /usr/include/sys/types.h:133,
                 from selftest_dma.c:3:
/usr/include/time.h:105: error: conflicting types for ‘timer_t’
/usr/include/linux/types.h:22: error: previous declaration of ‘timer_t’ was here
In file included from /usr/include/sys/types.h:220,
                 from selftest_dma.c:3:
/usr/include/sys/select.h:78: error: conflicting types for ‘fd_set’
/usr/include/linux/types.h:12: error: previous declaration of ‘fd_set’ was here
In file included from selftest_dma.c:3:
/usr/include/sys/types.h:235: error: conflicting types for ‘blkcnt_t’
/usr/include/linux/types.h:114: error: previous declaration of ‘blkcnt_t’ was here
make[1]: *** [selftest_dma.o] Error 1
make[1]: Leaving directory `/root/NF2/projects/selftest/sw'
make: *** [projects/selftest/sw] Error 2
[root@localhost NF2]#

Jenerally speaking, the file of sys/types or others in sys directory are used when the designer try to compile a application software and the file of linux/types or others are used when he try to compile a driver for this is the kernel C heads.

But why here the sys and linux heads load  at the same time?