64-bit Ubuntu compiled 32-bit program

Source: Internet
Author: User

If you encounter the need to emulate a 32-bit system when using the C4 gadget, we find that the compile prompt error after using the-m32 parameter is as follows:

/usr/bin/ld1 exit status

The first thing to do is to turn on 32-bit support for 64-bit systems

Step one: Confirm that 64 is the kernel of the architecture

Dpkg--print-architecture

Output:
Adm64

Description already has a 64-bit architecture kernel.

Step two: Confirm that the multi-schema support feature is turned on

Dpkg--print-foreign-architectures

Output:
I386

The description is turned on if you do not need to open it manually

Open Multi-schema support

sudo dpkg--add-architecture i386sudo apt-get updatesudo apt-get Dist-upgrade

And so you have 64-bit system support for 32-bit

followed by the installation of GCC Multilab

Install gcc-multilib g++-multilib  

64-bit Ubuntu compiled 32-bit program

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.