Tag Archives: cross compile

mingw – cross compile x64 libavcodec on debian6

This is a guide of cross compile libavcodec into mingw32 bit to run on win64 system from linux debian6 64bit version:

  1. git clone the libavcodec: git clone git://git.libav.org/libav.git
  2. apt-get install gcc-mingw32
  3. ./configure –enable-cross-compile –enable-w32threads –cross-prefix=amd64-mingw32msvc- –arch=x86_32 –target-os=mingw32 –enable-memalign-hack –enable-shared

This is actually a mistake because I want to get x86 code, it turns out amd64-mingw32msvc on debian6 x64 is generate x64 code, it’s pretty confusing here. So keep it simple, if you want to have x86 bits, do this steps:

  1. install mingw32 on win32 OS
  2. git clone the latest libavcodec: git clone git://git.libav.org/libav.git
  3. go the source directory:
    ./configure --enable-w32threads --enable-memalign-hack --enable-shared
  4. make

 

 

Have fun.