Re: open call and conflicting headers

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



i found a solution, but it does not give me great satisfaction though. the <linux/types.h> header comes in due to #include <linux/videodev.h> (video4linux). previously, i've put the headers necessary for the open syscall AFTER <linux/videodev.h>, and that gave the problem of conflicting types. now, i reversed the order and the problem is gone:

#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/videodev.h>

BUT, i am still interested in the reason of having a sys/types.h and a linux/types.h defining the same stuff, and why reversing the order fixes the problem. it would also be great if someone could point me to a document where the syscalls and their necessary headerfiles are listed (i could only find a document @ linuxhq.com listing the syscalls and the .c files where they are defined).

greets,
geert.


Geert Fannes wrote:


hello, i want to use the "open" systemcall, but i get conflicting headers when i use the header that 'man open' suggests (these are <sys/types.h>, <sys/stat.h> and <fcntl.h>):

In file included from GEye.cpp:6:
/usr/include/sys/types.h:61: conflicting types for `typedef __dev_t dev_t'
/usr/include/linux/types.h:14: previous declaration as `typedef __kernel_dev_t
dev_t'
/usr/include/sys/types.h:66: conflicting types for `typedef __gid_t gid_t'
/usr/include/linux/types.h:41: previous declaration as `typedef __kernel_gid_t
gid_t'
/usr/include/sys/types.h:71: conflicting types for `typedef __mode_t mode_t'
/usr/include/linux/types.h:16: previous declaration as `typedef __kernel_mode_t
mode_t'
/usr/include/sys/types.h:76: conflicting types for `typedef __nlink_t nlink_t'
/usr/include/linux/types.h:17: previous declaration as `typedef
__kernel_nlink_t nlink_t'
/usr/include/sys/types.h:81: conflicting types for `typedef __uid_t uid_t'
/usr/include/linux/types.h:40: previous declaration as `typedef __kernel_uid_t
uid_t'


i am not sure where the "/usr/include/linux/types.h" comes from, i use gtk2.0 also in this program (and v4l). can anyone help me to determine which of the two types.h is deprecated, or how i can solve this problem.

thank you,
geert.



--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/



[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux