Compile Program for 32Bit on 64Bit Linux Os Causes Fatal Error

Compile program for 32bit on 64bit Linux OS causes fatal error

To compile 32 bit binaries on 64 bit Linux version, you have to Install libx32gcc development package and 32 bit GNU C Library

try this

sudo apt-get install libx32gcc-4.8-dev

and

sudo apt-get install libc6-dev-i386

sys/socket.h fatal error trying to compile 32 bit library on 64 bit Linux platform

You need to provide the path of asm. Just check the path and link like this. Depending on system path may vary. Most of the time downloading gcc-multilib solve this issue.

$cd /usr/include
$sudo ln -s asm-generic/ asm

OR

$cd /usr/include
$sudo ln -s x86_64-linux-gnu/asm asm

fatal error: bits/libc-header-start.h: No such file or directory while compiling HTK

The -m32 is telling gcc to compile for a 32-bit platform. On a 64-bit machine, gcc normally only comes with 64-bit libraries. You have two options:

  1. Install 32-bit headers and libraries. Here's how you'd do this on Ubuntu.

    Run this command:

    sudo apt-get install gcc-multilib
  2. Compile for 64-bit instead. Modify this line in the file named configure:

     CFLAGS="-m32 -ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"

    Delete -m32, giving you:

     CFLAGS="-ansi -D_SVID_SOURCE -DOSS_AUDIO -D'ARCH=\"$host_cpu\"' $CFLAGS"

    Run ./configure, then make clean, then make

    However, I would recommend against this approach. The library authors went out of their way to make this build for 32 bits on a 64 bit system, and I can't guarantee that it will work correctly if you do this. (It does compile, though.)

VS COM Project Compiles in 32bit but throws error C2259 when trying to compile 64bit

Your GetCommandString parameters do not match those defined by the interface method.

Your

STDMETHODIMP GetCommandString(UINT, UINT, UINT*, LPSTR, UINT)

needs to be

STDMETHODIMP GetCommandString(UINT_PTR, UINT, UINT*, LPSTR, UINT)

In Win32 the mismatch is not so much important (the parameter types resolve to the same type), and in x64 is becomes important. Compiler build output should have given you a hint on this, including the missing method name.

converting a 64bit .so to 32bit

You can't.

You need to get 32bit version of this 3rd part library or recompile it from its sources



Related Topics



Leave a reply



Submit