ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Do you include both <sys/types.h> and <linux/types.h> in the file that has the error? Please list the includes for the file that has the error, and also the includes for those files included (if they are your files, too.)
ta0kira
I did'nt include both <sys/types.h> and <linux/types.h>. I am using sys/statvfs but I am also using something from <include/linux/> which is cdrom.h. could this be a problem?
This is really weird because i can compile in Ubuntu but I can't compile in opensuse. What is the difference between these distribution? I can't really understand the conflict made.
The top of /usr/linux/cdrom.h on my (Mandriva) system has this:
Code:
/*******************************************************
* As of Linux 2.1.x, all Linux CD-ROM application programs will use this
* (and only this) include file. ...
So apparently the author wants you to delete the #include lines for sys/types.h and sys/statvfs.h.
If that leaves some things undefined or undeclared, maybe you could break your file into two files and only include cdrom.h in one of them.
You need to make sure that anything that uses one version of a typedef isn't used by something that uses another. In other words, you should probably isolate the use of <linux/cdrom.h> to a single source file and give it an interface .h (if it even needs one) that doesn't use any of those typedefs to avoid malformed binary code. You'll have major problems if one source thinks a type is a different size or sign than another source does, which can easily happen with typedefs that differ source-to-source.
ta0kira
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.