Adding this answer partially because it fixed my problem of the same issue and so I can bookmark this question myself.

I was able to fix it by doing the following:

sudo apt-get install gcc-multilib g++-multilib

If you've installed a version of gcc / g++ that doesn't ship by default (such as g++-4.8 on lucid) you'll want to match the version as well:

sudo apt-get install gcc-4.8-multilib g++-4.8-multilib
Answer from anthony sottile on Stack Overflow
🌐
Stack Overflow
stackoverflow.com › questions › 42982647 › theano-in-centos-7-with-error-bits-cconfig-h-no-such-file-or-directory
python - Theano in Centos 7 with error bits/c++config.h: No such file or directory - Stack Overflow
March 23, 2017 - I got the error: Problem occurred during compilation with the command line below: /usr/bin/g++ -shared -g -O3 -fno-math-errno -Wno-unused-label -Wno-unused-variable -Wno-write-strings -
🌐
GitHub
github.com › openssl › openssl › issues › 19193
build error with "bits/c++config.h" not found on "centos7 : gcc7.x(custom build)" · Issue #19193 · openssl/openssl
September 12, 2022 - GNU C11 (GCC) version 7.5.0 (x86_64-pc-linux-gnu) compiled by GNU C version 7.5.0, GMP version 6.1.0, MPFR version 3.1.4, MPC version 1.0.3, isl version isl-0.16.1-GMP GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 603929c6f011d7fc018cbe41e3a1c3b8 In file included from test/rsa_complex.c:17:0: /usr/local/gcc-7.5.0/include/c++/7.5.0/complex.h:29:10: fatal error: bits/c++config.h: No such file or directory #include <bits/c++config.h> ^~~~~~~~~~~~~~~~~~ compilation terminated.
Author   whyjp
🌐
Launchpad
answers.launchpad.net › madanalysis5 › +question › 695844
Question #695844 “Compilation problem: bits/c++config.h: No such...” : Questions : MadAnalysis 5
38:28: fatal error: bits/c++config.h: No such file or directory #include <bits/c++config.h> ^ compilation terminated. make: *** [PortabilityChe · ckup/Portabilit · yCheckup. o] Error 1 · The issue repeats if a try v1.7. However I don't have any problems with mac os, so maybe is a problem of the configuration on my liunx system. Here are some specs: Linux system: NAME="CentOS Linux" VERSION="7 (Core)" Linux 3.10.0- 862.11.
🌐
PlatformIO Community
community.platformio.org › platformio core
ESP32 not compiling on windows. bits/c++config.h: No such file or directory - PlatformIO Core - PlatformIO Community
January 19, 2021 - Hello all, I use PIO since a few month and I am far from an expert. I wrote lots of tests and a few nice projects on ESp32 and I was happy with it. I updated my windows PC to Windows 10 a few weeks ago. Reinstalled arduino IDE, VS code, PIO… Since then, my program don’t compile as the file bits/c++config.h is missing.
Top answer
1 of 3
164

The -m32 is telling gcc to compile for a 32-bit platform. On a 64-bit platform, gcc normally only comes with 64-bit libraries. You have two options:

  1. Install 32-bit headers and libraries. Here's how you'd do this on Ubuntu.

    Run this command:

    sudo apt-get install gcc-multilib
    
  2. Compile for 64-bit instead. Modify this line in the file named configure:

     CFLAGS="-m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"
    

    Delete -m32, giving you:

     CFLAGS="-ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"
    

    Run ./configure, then make clean, then make

    However, I would recommend against this approach. The library authors went out of their way to make this build for 32 bits on a 64 bit system, and I can't guarantee that it will work correctly if you do this. (It does compile, though.)

2 of 3
19

Below is one way to debug and fix this issue. Since most linux installations differ in one way or another, YMMV.

  1. Find which package installed libc-header-start.h.
$ dpkg -S libc-header-start.h
libc6-dev:amd64: /usr/include/x86_64-linux-gnu/bits/libc-header-start.h

On a working system, /usr/include/bits is a symlink to /usr/include/x86_64-linux-gnu/bits. Running dpkg search gives us:

$ dpkg -S /usr/include/bits
libc6-dev-i386: /usr/include/bits

Installing libc6-dev-i386 creates the symlink and the error is addressed.

However, subsequently I ran into a linker error with the linker not being able to find libgcc (-lgcc). Apparently Linux default linker needs libgcc in most cases. Further debugging the issue with linker verbosity enabled lead me to missing lib32gcc-10-dev package.

In short, unless a very controlled build environment is desired, just install gcc-multilib package when using -m32 (needed for gcc or clang). For C++, g++-multilib is also required.

🌐
OpenGenus
iq.opengenus.org › bits-c-config-h-no-such-file-or-directory
[Fixed] fatal error: bits/c++config.h: No such file or directory
November 1, 2022 - With this article at OpenGenus, we have resolved the error "fatal error: bits/c++config.h: No such file or directory".
Find elsewhere
🌐
GitHub
github.com › xianyi › OpenBLAS › issues › 2202
Make error: bits/c++config.h: No such file or directory · Issue #2202 · OpenMathLib/OpenBLAS
June 9, 2019 - I am using anaconda's gcc_linux-64 with no multilib support. When I execute make I get .../include/c++/7.3.0/complex.h:29:10: fatal error: bits/c++config.h: No such file or directory #include which is invoked in file c...
Author   gerwang
🌐
Red Hat
bugzilla.redhat.com › show_bug.cgi
1896076 – Unable to compile anything with Clang: bits/c++config.h not found
Red Hat Bugzilla – Bug 1896076 · This site requires JavaScript to be enabled to function correctly, please enable it · Privacy Contact FAQ Legal
🌐
GitHub
github.com › siemens › meta-iot2000 › issues › 18
build example build error - bits/c++config.h: No such file or directory · Issue #18 · siemens/meta-iot2000
April 11, 2017 - | In file included from ../deps/v8/src/base/logging.h:8:0, | from ../deps/v8/src/base/division-by-constant.cc:9: | /usr/include/c++/5/cstring:41:28: fatal error: bits/c++config.h: No such file or directory | compilation terminated.
Author   jancumps
🌐
Arduino Forum
forum.arduino.cc › projects › programming
Fatal error: bits/c++config.h: No such file or directory - Programming - Arduino Forum
September 1, 2023 - So i have a project going where I am using Arduino IDE to program my ESP32-CAM but i keep running into the same error code again again and again. In TOOLS -> BOARD I use : AI THINKER ESP32-CAM. This is the error code : …
🌐
The Mail Archive
mail-archive.com › lfs-support@lists.linuxfromscratch.org › msg07162.html
Re: [lfs-support] fatal error: bits/c++config.h: No such file or directory
> > > > > make unit > > > > > make[1]: Entering directory '/usr/src/dejagnu/dejagnu-1.6.2' > > > > > depbase=`echo testsuite/libdejagnu/unit.o | sed > > > > > 's|[^/]*$|.deps/&|;s|\.o$||'`; > > > > > \ > > > > > g++ -DPACKAGE_NAME=\"GNU\ DejaGnu\" -DPACKAGE_TARNAME=\"dejagnu\" > > > > > - > > > > > DPACKAGE_VERSION=\"1.6.2\" -DPACKAGE_STRING=\"GNU\ DejaGnu\ > > > > > 1.6.2\" - > > > > > DPACKAGE_BUGREPORT=\"bug-deja...@gnu.org\" - > > > > > DPACKAGE_URL=\"http://www.gnu.org/ > > > > > software/dejagnu/\" -DPACKAGE=\"dejagnu\" -DVERSION=\"1.6.2\" - > > > > > I. > > > > > -I. -g -g > > > > > -O2
🌐
Google Groups
groups.google.com › g › theano-users › c › nSc8ZLEB0OI
Theano in Centos 7 with error bits/c++config.h: No such file ...
March 23, 2017 - You don't have permission to access this content · For access, try logging in If you are subscribed to this group and have noticed abuse, report abusive group
🌐
Mozilla Bugzilla
bugzilla.mozilla.org › show_bug.cgi
871251 - fatal error: 'bits/c++config.h' file not found - Bugzilla
I get a build failure after upgrading to Ubuntu 13.04: clang++ -o Decimal.o -c -I../dist/system_wrappers -include /home/mats/moz/mc/config/gcc_hidden.h -DIMPL_MFBT -DMOZ_GLUE_IN_PROGRAM -DNO_NSPR_10_SUPPORT -I/home/mats/moz/mc/mfbt -I. -I../dist/include -I/OBJDIR/home/mats/moz/mc/dist/include/nspr -I/OBJDIR/home/mats/moz/mc/dist/include/nss -fPIC -Qunused-arguments -Qunused-arguments -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Wtype-limits -Wempty-body -Wsign-compare -Wno-invalid-offsetof -Wno-c++0x-extensions -Wno-extended-offsetof -Wno-unknown-warning-option -Wno-return-t
🌐
GitHub
github.com › ClickHouse › ClickHouse › issues › 32166
Build error: 'bits/c++config.h' file not found when building newest master version, but it is ok in 21.10 version. · Issue #32166 · ClickHouse/ClickHouse
November 1, 2021 - Operating system Linux sg-ch-test006.bigdata.bigo.inner 4.9.70-040970-generic #201712161132 SMP Sat Dec 16 16:33:52 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux Cmake version cmake version 3.16.3 Ninja version 1.10.0 Compiler name and version...
Author   taiyang-li