# Is it safe to symlink to /usr/include/x86_64-linux-gnu/sys from /usr/include/sys?

I'm missing the /usr/include/sys dir and all of its headers.
I have build-essentials and supposedly every other -dev package I require for this make.

From reading around I understand that it's safe to symlink to headers inside /usr/include/x86_64-linux-gnu/sys from /usr/include/sys because the headers at the target are 64bit yet work with 32bit building, unless a specific 32bit header is required.

It sounds reasonable to some extent, but I have my doubts.

The suggestion I read was to symlink to the specific headers, and I wonder if I can just symlink to the whole /usr/include/x86_64-linux-gnu/sys dir since I'm likely missing numerous headers.

.

Although this is a general question, I'll include the specific problem I encounter:

I'm failing to make fsthost. it says it's missing sys/types.h.
Looking around I saw a suggestion to install libc6-dev-i386, which ended up changing one missing header fault with another. So I removed it because it's for AMD.

This is what I get when trying to do make GTK2=1 for fsthost 1.5.4

gcc -c  -m32 -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libpng12 -I/usr/include/harfbuzz   -g -O2 -Wall -Wno-deprecated-declarations -Wno-multichar -frounding-math -fsignaling-nans -mfpmath=sse -msse2 -DNO_VUMETER -fno-pic -fno-PIC -I. -I/usr/include -I/usr/include -I/usr/include/wine -I/usr/include/wine/windows   -o gtk_32.o gtk.c
In file included from gtk.c:1:0:
jackvst.h:4:23: fatal error: sys/types.h: No such file or directory
#include <sys/types.h>
^
compilation terminated.
make: *** [gtk_32.o] Error 1


Running on Mint 17 Xfce.

• Are you trying to cross-compile, or do you want to do a 32-bit compile and run it on your x86_64 system? – Mark Plotnick Nov 26 '14 at 18:59
• According to the readme the make should spout out both a 64- and a 32-bit exe. I will probably end up using the 64-bit one. But that comment made me try forcing it to make only the 64, which worked like a charm. 32-bit doesn't work. In case I might need the 32-bit for future problems, how would I accomplish that? – pfff Nov 26 '14 at 19:05
• I don't know if Mint has it, but on Ubuntu you can install libc6-dev:i386 (note the :), which will install the proper header files into /usr/include/i386-linux-gnu/, as well as shared libraries, for an -m32 compilation. – Mark Plotnick Nov 26 '14 at 19:08
• I installed it, I get a bunch of missing things at /usr/bin/ld, such as /usr/bin/ld: cannot find -lX11 /usr/bin/ld: cannot find -ljack /usr/bin/ld: cannot find -lxml2 /usr/bin/ld: cannot find -lgtk-x11-2.0 and it ends with collect2: error: ld returned 1 exit status winegcc: gcc failed make: *** [fsthost32] Error 2 These are packages that I do have installed. (sorry I can't manage to make linebreaks in the comment to make this readable) – pfff Nov 26 '14 at 19:17
• You'll need to install the 32-bit versions of any libraries that the program may need. There are packages like (your names may differ) libx11-6:i386, libxml2:i386 and libgtk2.0-0:i386. – Mark Plotnick Nov 26 '14 at 19:27

The sys/types.h header belongs to glibc (or an alternative libc implementation if you are not using glibc). To get that header you should install the development package for glibc from your distribution.
On debian 7, this package is libc6-dev. For ubuntu it is either libc6-dev-i386 (32bit) or libc6-dev-amd64 (64 bit). These names will likely work depending on which distro your mint install inherits from.
Don't be put off that installing this package "which ended up changing one missing header fault with another". That is fine, you are missing many dependencies and your build will not complete until they are all there. From the comments you are also missing libraries for libjack, libxml2 and libgtk-x11-2.0. To resolve each of these you'll need to find the respective -dev packages for each. If you install the libc6-dev package and the build no longer complains about system headers then this problem is resolved and your other build issues are not directly related.
cd /usr/include ; for f in x86_64-linux-gnu/*
do g=$(basename$f) ; test -f $g -o -d$g -o -L $g && continue ln -s$f \$g ; done