Location (or version) of limits.h

Hello; I wonder if anyone can help with this.

I have installed OpenSuse 11.1 so that I can compile my Qt applications in Linux. However, having installed Qt Creator, I find that I cannot even compile the examples supplied by Nokia without getting the error:

linux/limits.h: No such file or directory

After trawling through many posts in many forums, I have worked out that (a) there is supposed to be a limits.h file in the /usr/lib/gcc/i586-suse-linux/4.3/include directory, but (b) the limits.h file is actually located in /usr/lib/gcc/i586-suse-linux/4.3/include-fixed, along with “syslimits.h” and a “README” file that I can’t make head nor tail of.

If I try simply to copy the files from ‘include-fixed’ to ‘include’, it doesn’t let me; it doesn’t even ask for an admin password, I just get a dialog saying “Access denied” and a ‘Cancel’ button.

So, how can I fix this?

you need the kernel limits.h header, not the one in gcc or something else. limits.h is provided by the linux-kernel-headers package and it contains, among other header files, the file limits.h which is located in /usr/include/linux

it is even tell you that it needs a file called limits.h and is looking in the directory linux (which is really /usr/include/linux)

Actually, I found that if I logged in as Admin (rather than simply using sudo to give Admin privileges to my normal user name), I could move the files. It hasn’t made any difference, however; I still see the same error message when I try to compile in Qt.

It’s almost as if Qt is using another installation of gcc somewhere on the hard disk, but if so then I haven’t been able to locate it.

Thank you. Unfortunately, I don’t seem to have a /usr/inlcude/linux directory; maybe that is my problem! Where can I find the means to install it?

I told you already. Install package linux-kernel-headers which contains and dumps headers in /usr/include/linux

on my system:

neutrino@neutrino:~> rpm -qf /usr/include/linux/limits.h


Please make sure that the packages ‘linux-kernel-headers’ and ‘glibc-devel’ are installed. The former one will provide /usr/include/linux/limits.h

SORRY, did not check that this has already been answered by others.

Thank you both; according to YaST2, both packages are installed already.

Unfortunately, it’s essential that I leave the office in a few minutes and won’t be back till Tuesday. I’ll have another look at it then.

Correction; kernel-headers isn’t showing as installed, only as ‘available’. First thing on Tuesday morning I’ll try to figure out how to install it.

zypper in linux-kernel-headers


YaST2 installed it automatically before shutting down. Now my application compileslol!

…and now I’m late:(

Thank you very much for your help.