title: undefined reference to _imp_sfBlendAlpha
body: <p>I have recently installed MinGW and CSFML on my laptop and I run:  </p>
  
  <pre><code>gcc shaders.c -csfml-system -csfml-graphics
  </code></pre>
  
  <p>I get an error:</p>
  
  <pre><code>...\ccV1NsAK.o:shaders.c:(.text+0x247):' undefined reference to _imp__sfBlendAlpha'
  </code></pre>
  
  <p>How do I fix this?<br>
  Kind Regards,
  Boston Brooks.</p>
  
  <hr>
  
  <p><strong>Update 1</strong><br>
  I've played around with installing to different search paths but I couldn't get this to work. I reinstalled MinGW and pasted the files from the CSFML package to the default path. Now I get:</p>
  
  <pre><code>gcc shaders.c -lcsfml-system -lcsfml-window -lcsfml-graphics
  C:\Users\bbroo\AppData\Local\Temp\cc9QM4Nx.o:shaders.c:(.text+0x2d8): undefined reference to '_imp__sfBlendAlpha'
  C:\Users\bbroo\AppData\Local\Temp\cc9QM4Nx.o:shaders.c:(.text+0x318): undefined reference to '_imp__sfTransform_Identity'
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <hr>
  
  <p><strong>Update 2</strong><br>
  I copied CSFML to my home folder. I get:   </p>
  
  <pre><code>$ gcc -B ~/CSFML -Ld: ~/CSFML shaders.c  -lcsfml-system -lcsfml-window -lcsfml-graphics
  c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find C:/MinGW/msys/1.0/home/bbroo/CSFML: Permission denied
  c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lcsfml-system
  c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lcsfml-window
  c:/mingw/bin/../lib/gcc/mingw32/5.3.0/../../../../mingw32/bin/ld.exe: cannot find -lcsfml-graphics
  collect2.exe: error: ld returned 1 exit status
  </code></pre>
  
  <p>The header files can be accessed but the dot-a files are 'permission denied'
  How do I set the permissions to Read-Write-Execute for all users on all files in CSFML using MSYS?</p>
  
  <p>Same problem if I use C:\SFML</p>
  
  <hr>
  
  <p><strong>Update 3</strong><br>
  When I unzip the files to the default path, a sub-folder is generated in the folder where my dot-a files are located. It contains several dot-a files, and a readme text file.</p>
  
  <p>This README file is copied into the directory for GCC-only header files
  when fixincludes is run by the makefile for GCC:</p>
  
  <blockquote>
    <p>Many of the files in this directory were automatically edited from the
    standard system header files by the fixincludes process.  They are
    system-specific, and will not work on any other kind of system.  They
    are also not part of GCC.  The reason we have to do this is because
    GCC requires ANSI C headers and many vendors supply ANSI-incompatible
    headers.  </p>
    
    <p>Because this is an automated process, sometimes headers get "fixed"
    that do not, strictly speaking, need a fix.  As long as nothing is broken
    by the process, it is just an unfortunate collateral inconvenience.
    We would like to rectify it, if it is not "too inconvenient".</p>
  </blockquote>
  
  <hr>
  
  <p><strong>Update 4</strong><br>
  Compiling without linking worked fine but linking separately didn't work:</p>
  
  <pre><code>bbroo@DESKTOP-1F1J3SM ~/Shaders
  $ ld shaders.o libcsfml-system.a libcsfml-window.a libcsfml-graphics.a
  shaders.o:shaders.c:(.text+0x10): undefined reference to `__main'
  shaders.o:shaders.c:(.text+0x2d8): undefined reference to `_imp__sfBlendAlpha'
  shaders.o:shaders.c:(.text+0x318): undefined reference to `_imp__sfTransform_Identity'
  shaders.o:shaders.c:(.text+0x4bc): undefined reference to `sleep'
  </code></pre>
  
  <hr>
  
  <p><strong>Update 5</strong><br>
  Now I get: </p>
  
  <pre><code>bbroo@DESKTOP-1F1J3SM ~/Shaders
  $ ld shaders.o libcsfml-system.a libcsfml-window.a libcsfml-graphics.a csfml-system-2.dll csfml-window-2.dll csfml-graphics-2.dll
  shaders.o:shaders.c:(.text+0x10): undefined reference to `__main'
  shaders.o:shaders.c:(.text+0x4bc): undefined reference to `sleep'
  </code></pre>