title: Linking with pe-i386 object file and a pe-x86-64 object file
body: <p>Because my understanding of this problem is limited, please excuse me if I provide irrelevant details.</p>
  <h2>Question</h2>
  <p>I have two versions of MingGW on my computer, and both are 32-bit. The first one is what I call &quot;basic MinGW&quot;, and it's the one I installed using mingw-get several years ago. The other one came with MSYS2.</p>
  <p>Here are the constraints I am dealing with, details provided in the postscript:</p>
  <ul>
  <li>My program depends on library A, which I can only compile from source using the MSYS2 MinGW.</li>
  <li>My program depends on B.dll, a file that was provided to me. I do not have the source.</li>
  <li>Using <code>objdump</code>, I discovered that B.dll has file format <code>pe-i386</code></li>
  <li>Using <code>objdump</code>, I discovered that programs compiled with the basic MinGW have file format <code>pe-i386</code></li>
  <li>Using <code>objdump</code>, I discovered that programs compiled with the MSYS2 MinGW have file format <code>pe-x86-64</code></li>
  </ul>
  <p>The end result is this:</p>
  <ul>
  <li>My program cannot compile with the basic MinGW because library A (which must be compiled with MSYS2 MinGW) is incompatible</li>
  <li>My program cannot compile with the MSYS2 MinGW because B.dll is incompatible</li>
  </ul>
  <p>What is the difference between these two file formats? If they are both 32-bit, why can't I compile them together? Is it possible to convert B.dll to be compatible with the MSYS2 MinGW?</p>
  <h2>Details</h2>
  <ul>
  <li>Library A is libevent. At some point, libevent requires <code>netioapi.h</code> which does not appear to be present in the basic MinGW. However, MSYS2 MinGW is able to compile libevent.</li>
  <li>B.dll is provided to me in Modelsim. It is the library you must link against fro compiling Verilog PLI programs.</li>
  </ul>