gcc cannot find bits/predefs.h on i686

Solution 1:

Try doing a

sudo apt-get install gcc-multilib

I don't think that installing a 32-bit system changes the architecture of your computer, because your computer will always be a 64-bit machine. Installing the 64-bit version of Ubuntu should only give better multi-core performance. Since your computer is still a 64-bit computer, you probably need a C compiler that will compile on 64-bit machines. Hence the gcc-multilib. I think.

Solution 2:

the gcc-multilib trick didn't work out for me. Instead, setting this in the build environment did the trick:

C_INCLUDE_PATH=/usr/include/$(gcc -print-multiarch)