2022年11月11日 星期五

Build Eclipse 32bit C/C++ projects on a 64-bit system

 [] In eclips project explorer,Add extra "-m32" for both compiler and linker

Project->Properties --> C/C++ Build --> Settings 

-->Tool settings 

  -->gcc c compiler --> command: gcc -m32

  -->gcc c linker --> command: gcc -m32


[] extra Required Packages: add some as you need

Installing the following packages enabled standard C/C++ library calls to work. If other libraries are used within the code, additional 32-bit packages might have to be installed. Installation via Linux Mint, based on Ubuntu, is via the standard apt-get install command.

$sudo apt-get install g++-multilib lib32gcc1 libc6-i386 lib32z1 lib32stdc++6

$sudo apt-get install lib32asound2 lib32ncurses5 lib32gomp1 lib32z1-dev lib32bz2-dev

This might also be required if the code still does not compile:

$sudo apt-get install ia32-libs-gtk

After adding the suggested package libc6-dbg, the error still occurred. Installing the 32-bit version of the package fixed the error:

$sudo apt-get install libc6-dbg:i386

[]rember clean project befor first time compile new bitwidth-archecture


沒有留言:

張貼留言

別說人生 沒意義

  活著 本身就 很有 意義 !  在當代 億萬人群 中,不然 千秋萬代人 總有 能人 能找到 更多更好 的 意義.