3

My Linux Server information is:

[root@centos nan]# uname -a
Linux centos 2.6.32-279.el6.x86_64 #1 SMP Fri Jun 22 12:19:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux

By default, the gcc will generate the 64-bit executable file, so I use the "-m32" flags to build 32-bit executable file.

After running the following command:

[root@centos nan]# gcc -m32 -o a a.c
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status  

So how to build 32-bit executable file in 64-bit Linux?

Ciro Santilli OurBigBook.com
  • 347,512
  • 102
  • 1,199
  • 985
Nan Xiao
  • 16,671
  • 18
  • 103
  • 164
  • Take a look at this answer http://stackoverflow.com/questions/8421110/building-a-32-bit-app-in-64-bit-ubuntu?rq=1 you need to link with 32-bit libraries as well as compile – mikea Feb 12 '14 at 10:04
  • 2
    Have you checked the answer for http://stackoverflow.com/questions/9807581/cannot-find-crtn-o-linking-32-bit-code-on-64-bit-system ? – Michael Feb 12 '14 at 10:04

0 Answers0