Compilation fails with 'error: gnu/stubs-32.h: No such file or directory' when building a program with -m32 gcc argument
Issue
- Compilation fails with 'error: gnu/stubs-32.h: No such file or directory' when building a program with -m32 gcc argument
-
As an example, build the following program:
#include <iostream>
using namespace std;int main(){
cout << "HELLO\n";
return 0;
}with the command:
g++ -m32 t.CThe output is as follows:
In file included from /usr/include/features.h:385,
from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/32/bits/os_defines.h:39,
from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/x86_64-redhat-linux/32/bits/c++config.h:243,
from /usr/lib/gcc/x86_64-redhat-linux/4.4.4/../../../../include/c++/4.4.4/iostream:39,
from t.C:1:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory
Environment
-
Red Hat Enterprise Linux 6
-
Red Hat Enterprise Linux 5
- Red Hat Enterprise Linux 4
-
x86_64 architecture
-
glibc-devel
- gcc
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
