title: How to cross-compile a Chromium Embedded Framework (CEF) Windows app on Linux using MinGW
body: <p>I'm trying to compile the cefclient and cefsimple applications provided in the <a href="https://cefbuilds.com/" rel="nofollow">CEF3 distribution</a> into Windows executables from my Linux machine.</p>
  
  <p>I'm running Linux Mint 17 (64-bit), and I'm trying to compile the Windows 32-bit versions of cefclient and cefsimple from <a href="https://cefbuilds.com/#branch_2454" rel="nofollow">Branch 2454</a>. </p>
  
  <p>I have cmake and the MinGW cross-compilers installed, and I tested each individually. They all work well. I also have the build-essential, libgtk2.0-dev, and libgtkglext1-dev dependencies installed.</p>
  
  <p>When I try to build the MakeFiles from a new <code>CEF/build</code> directory, I get an error:</p>
  
  <hr>
  
  <p><strong>Command:</strong></p>
  
  <p><code>&gt; cmake -G "Unix Makefiles" -D CMAKE_C_COMPILER=i686-w64-mingw32-gcc -D CMAKE_CXX_COMPILER=i686-w64-mingw32-g++ ..</code></p>
  
  <p><strong>CMakeError.log</strong></p>
  
  <pre><code>Determining if the C compiler works failed with the following output:
  
  Change Dir: /path/to/CEF/Source/build/CMakeFiles/CMakeTmp
  
  Run Build Command:/usr/bin/make "cmTryCompileExec1497229498/fast"
  
  /usr/bin/make -f CMakeFiles/cmTryCompileExec1497229498.dir/build.make CMakeFiles/cmTryCompileExec1497229498.dir/build
  
  make[1]: Entering directory '/path/to/CEF/Source/build/CMakeFiles/CMakeTmp'
  
  /usr/bin/cmake -E cmake_progress_report /path/to/CEF/Source/build/CMakeFiles/CMakeTmp/CMakeFiles 1
  
  Building C object 
  
  CMakeFiles/cmTryCompileExec1497229498.dir/testCCompiler.c.o
  
  /usr/bin/i686-w64-mingw32-gcc    -o 
  CMakeFiles/cmTryCompileExec1497229498.dir/testCCompiler.c.o   -c     /path/to/CEF/Source/build/CMakeFiles/CMakeTmp/testCCompiler.c
  
  Linking C executable cmTryCompileExec1497229498
  
  /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTryCompileExec1497229498.dir/link.txt --verbose=1
  
  /usr/bin/i686-w64-mingw32-gcc       CMakeFiles/cmTryCompileExec1497229498.dir/testCCompiler.c.o  -o cmTryCompileExec1497229498 -rdynamic
  
  i686-w64-mingw32-gcc: error: unrecognized command line option '-rdynamic'
  
  make[1]: *** [cmTryCompileExec1497229498] Error 1
  
  make[1]: Leaving directory `/path/to/CEF/Source/build/CMakeFiles/CMakeTmp'
  
  make: *** [cmTryCompileExec1497229498/fast] Error 2
  </code></pre>
  
  <hr>
  
  <p>This is my first attempt to cross-compile anything from Linux to Windows. Am I doing it wrong? Is there something I'm missing? What is the error message indicating?</p>