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:
Install 32-bit headers and libraries. Here's how you'd do this on Ubuntu.
Run this command:
sudo apt-get install gcc-multilib
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
, thenmake clean
, thenmake
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
How to Choose Heap Allocation VS. Stack Allocation in C++
Setting Width in C++ Output Stream
What Data Structure, Exactly, Are Deques in C++
What's a Good and Stable C++ Tree Implementation
What Is Wrong with Making a Unit Test a Friend of the Class It Is Testing
How to Use a Lambda Expression as a Template Parameter
How to Catch Out of Memory Exception in C++
C++ Frontend Only Compiler (Convert C++ to C)
How to Read Jpeg and Png Pixels in C++ on Linux
Is Using a Vector of Boolean Values Slower Than a Dynamic Bitset
Passing Member Function Pointer to Member Object in C++
Reading and Writing to Usb (Hid) Interrupt Endpoints on MAC