Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently upgraded from Kubuntu 12.04 to 13.04, a complete reinstall.

Using gcc 4.7.3. I compiled some programs to discover there is no /usr/include/sys directory. That is, types.h, stat.h, etc, are absent. They exist in the include/linux directory but not include/sys.

What's going on?

share|improve this question
What's the error message that GCC prints? Please edit the question to provide this and other information related to your problem. – edwin Feb 1 '14 at 16:09
Do you have build essential installed? – Seth Feb 1 '14 at 16:17
The couple of programs I have tried compile fine so there is no error message from gcc. I just can't figure where the header is coming from. I have an editor that builds references to functions and syscall and the like and it isn't happy that it can't find the directory. – Duck Feb 1 '14 at 16:20
Yes, build-essential is up to date. – Duck Feb 1 '14 at 16:22
up vote 5 down vote accepted

If you use Ubuntu on 64-bit (I can't text exactly right now on a 32-bit system), then the directory from the question is:


Now, having this information, you can create symbolic links to those files if you really need them at that location (/usr/include/sys) using this on a terminal:

sudo ln -s /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/sys/types.h
sudo ln -s /usr/include/x86_64-linux-gnu/sys/stat.h /usr/include/sys/stat.h

# ...etc
share|improve this answer
Yes, 64 bit. I read something similar elsewhere and it seems like everything is in that directory but I am not certain how the headers are getting included from the "#include sys/stat.h" to the x86_64/sys directory. Is this some new fangled gcc injection feature? Off-hand I don't see any symlinks or the like that would (externally) lead to this behavior. – Duck Feb 1 '14 at 16:37
Looks like we passed each other in the wind. So the bottom line is that the compiler is doing some magic but I may need to use some symlink hacks to make my editor happy? – Duck Feb 1 '14 at 16:39
@Duck I just edited my answer before 2 min of your comments :) – Radu Rădeanu Feb 1 '14 at 16:44

install libc6-dev-amd64 if you working on a 64-bit linux. Type the following command on the ubuntu terminal:

sudo apt-get install libc6-dev-amd64
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.