简体   繁体   中英

How to Compile 32-bit Apps on 64-bit RHEL?

I'm trying to compile a 32-bit C application on RHEL 7 64-bit using gcc 4.8. I'm getting a compiler error /usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory . What do I need to do to get 32 bit apps compiled and linked?

To get RHEL 7 64-bit to compile gcc 4.8 32-bit programs, you'll need to do two things.

  1. Make sure all the 32-bit gcc 4.8 development tools are completely installed:

     sudo yum install glibc-devel.i686 libgcc.i686 libstdc++-devel.i686 ncurses-devel.i686 
  2. Compile programs using the -m32 flag

     gcc pgm.c -m32 -o pgm 

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM