GCC 攻略 gaunthan Posted on Mar 3 2017 ? Compiler ? ## 64位系统生成32位程序 在64位系统上,可以使用`-m32`选项使GCC生成32位的程序,如: gcc -m32 -o hello helloworld.c 如果系统缺乏32位的运行时库,则可能会遇到以下错误:  这时候安装相应的32位库即可。在*Fedora 25 x86_64*系统上,需要安装`glibc-devel.i686`: sudo dnf install glibc-devel.i686 如果需要生成32位C++程序,则还需要安装`libstdc++-devel.i686`: sudo dnf install libstdc++-devel.i686 可以通过下图获悉您的系统需要安装的库:  *(截图来自:[Error “gnu/stubs-32.h: No such file or directory” while compiling Nachos source code](http://stackoverflow.com/questions/7412548/error-gnu-stubs-32-h-no-such-file-or-directory-while-compiling-nachos-source))* ## References - [Sun Studio 12 Update 1:C 用户指南 B.2.45 -m32|-m64](http://docs.oracle.com/cd/E19205-01/821-0387/gewif/). - [/usr/include/gnu/stubs.h:7:27: 致命错误:gnu/stubs-32.h:没有那个文件或目录](http://blog.csdn.net/k7arm/article/details/51682054). - [x86_64 Linux Error: gnu/stub-32.h Missing Error and Solution](https://www.cyberciti.biz/faq/x86_64-linux-error-gnustub-32h-missing-error-and-solution/). 赏 Wechat Pay Alipay MySQL Installation Guide binutils 二进制工具包使用说明