在ubuntu下 编译23位的测试文件

  $ sudo apt-get install build-essential module-assistant  

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

  $ gcc -m32 test.c  

  $ file a.out  

    a.out: ELF 32-bit LSB executable ...  

  $ ./a.out  

  sizeof long is 4  

  参考博客:

在64位linux下编译32位程序 - 小时候挺菜 - 博客园

posted @ 2025-07-16 15:06  靖意风  Views(9)  Comments(0)    收藏  举报