64-bit Ubuntu compiled 32-bit program

Source: Internet
Author: User

64-bit Ubuntu compiled 32-bit programs such as the use of C4 this gadget encountered to need to simulate the needs of 32-bit systems, found that using the-m32 parameter, the compilation prompt error, as follows:

/USR/BIN/LD: Unknown emulation mode: 32 supported emulation: elf_x86_64 elf32_x86_64 elf_i386 i386linux elf_l1om elf_k1om i386pep i386pe Collect2:erro R:ld returned 1 exit status first to open 64-bit system support for 32-bit

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

Dpkg--print-architecture

Output: adm64 description already has a 64-bit architecture core.

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

Dpkg--print-foreign-architectures

Output: I386 description is turned on, if no need to open manually

Open Multi-schema support

sudo dpkg--add-architecture i386 sudo apt-get update sudo apt-get dist-upgrade so you have 64-bit system support for 32-bit

followed by the installation of GCC Multilab

Apt-get 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.