Software⏱️ 2 min read📅 2026-05-31

How to Fix: Missing include "bits/c++config.h" when cross compiling 64 bit program on 32 bit in Ubuntu

Fix missing include bits/c++config.h when cross compiling 64 bit program on 32 bit in Ubuntu

Quick Answer: Use -m32 flag instead of -m64

To resolve the missing include 'bits/c++config.h' when cross-compiling a 64-bit program on a 32-bit Ubuntu system, you need to install the 'lib32gcc1' package.

🔍 Why This Happens

  • [Cause]

🚀 How to Resolve This Issue

Method 1: Install lib32gcc1 Package

  1. Step 1: Open a terminal and run the following command to install 'lib32gcc1': sudo apt-get install lib32gcc1

Method 2: Update Your System

  1. Step 1: Run the following command to update your system: sudo apt-get update && sudo apt-get upgrade -y

✨ Wrapping Up

By following these steps, you should be able to resolve the missing include 'bits/c++config.h' and successfully cross-compile your 64-bit program on a 32-bit Ubuntu system.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions