title: Running a GTK+ application built with MSYS2 by just double clicking it
body: <p>I have a <a href="https://developer.gnome.org/gtk3/stable/gtk-getting-started.html#id-1.2.3.5" rel="nofollow noreferrer">simple window</a> application, built with <a href="http://msys2.org" rel="nofollow noreferrer">MSYS2</a>, which I want to be able to run outside of the MSYS2 MinGW shell, just by double-clicking on the application. </p>
  
  <p>The problem is that when I want to run the application it must be  though the <code>MSYS MinGW</code> prompt otherwise it returns an error. </p>
  
  <pre><code>The code execution cannot proceed because libgio-2.0-0.dll was not found. Reinstalling the program may fix this problem
  </code></pre>
  
  <p>I tried including (by copying the files to the location of my exe)
  <code>libgio-2.0-0.dll</code> and more errors appeared saying libraries were missing.  I included those files too.  I have shown the files I included below:</p>
  
  <pre><code>libffi-6.dll
  libgdk-3-0.dll
  libglib-2.0-0.dll
  libgmodule-2.0-0.dll
  libgtk-3-0.dll
  libgobject-2.0-0.dll
  libgio-2.0-0.dll
  libatk-1.0-0.dll
  libcairo-gobject-2.dll
  libcairo-2.dll
  libepoxy-0.dll
  libpcre-1.dll
  libwinpthread-1.dll
  libgdk_pixbuf-2.0-0.dll
  libpango-1.0-0.dll
  </code></pre>
  
  <p>In the end an error appears saying:</p>
  
  <pre><code>The application was unable to start correctly (0xc000007b).  Click OK to close the application.
  </code></pre>
  
  <p><a href="https://www.reviversoft.com/blog/2013/11/how-to-solve-the-0xc000007b-unable-to-start-error/" rel="nofollow noreferrer">I found what the error message means:</a></p>
  
  <blockquote>
    <p>That particular error code refers to an invalid image format. However, what the error code usually means is that you are trying to run a program that is intended to work with a 64 bit Windows operating system, but that you only have a 32 bit OS.</p>
  </blockquote>
  
  <p>However it does not help as I am running an x64 computer.  The DLL are x64 as well as the exe.    </p>
  
  <p><a href="https://www.gtk.org/download/windows.php" rel="nofollow noreferrer">www.gtk.org</a> says GTK+ depends on some libraries and apart from what I have done above I cannot think of any solution and cannot find any documentation on what dependencies to include in order to not run it through the MSYS prompt.</p>
  
  <p>So what do I need to do to get my window working?  The application is fine there is a problem with the dependencies.</p>
  
  <p>Secondly what are the dependencies I need to include (or have I listed all of them in which case what is going wrong with my window)  for the script I gave?</p>
  
  <p>And finally is there an easier way than what I am trying to do to get all the necessary dependencies?</p>