title: How do I setup a Codeblocks project on Windows 10 to compile and link a static SFML project?
body: <p>My advance appologies for being hopeless at Windows development. I am by no means a Windows developer and my understanding of how to write, compile and link C++ code on a Windows system is limited to say the least.</p>
  <p>I am having difficulty trying to compile and link a SFML project on a Windows 10 system with the CodeBlocks IDE.</p>
  <p>I am trying to link this project with static linking, not dynamic linking. Again I have virtually no idea how the two different methods work in detail, I just know that if I ship a static linked binary to another Windows 10 user it is much more likely to &quot;just work&quot; on their system.</p>
  <p>List of things I did:</p>
  <ul>
  <li>Downloaded the latest version of CodeBlocks with MINGW integration.</li>
  <li>Installed, default options</li>
  <li>Downloaded the latest version of SFML (32bit MINGW version)</li>
  <li>Extracted the zip file (SFML) to my home directory</li>
  <li>Created a new codeblocks project (console application) and followed the instructions to set the compiler and linker options</li>
  </ul>
  <p><a href="https://www.sfml-dev.org/tutorials/2.5/start-cb.php" rel="nofollow noreferrer">https://www.sfml-dev.org/tutorials/2.5/start-cb.php</a></p>
  <p>It works fine for dynamic linking, but requires me to copy the .dll files to the same dir as the produced executable file (produced from compilation of my C++ code).</p>
  <p>I tried to change to static linking, changing the names of the linker libs with the <code>-s</code> or <code>-s-d</code> suffix, and adding the define <code>SMFL_STATIC</code> option to global (release and debug) options. I also added the opengl32, freetype, winmm and gdi32 link libs, <strong>before</strong> their respective sfml link libs.</p>
  <p>When trying to compile I get the following linker errors</p>
  <pre><code>cannot find -lfreetype
  cannot find -lsfml-graphics-s-d
  cannot find -lsfml-window-s-d
  cannot find -lsfml-system-s-d
  </code></pre>
  <p>in Release mode, similar errors are produced.</p>
  <p>What am I doing wrong?</p>