title: using winapi in mingw assembler
body: <p>I'm tring to compile the following assembly code into shared library (dll) </p>
  
  <pre><code>.extern _GetProcAddress
  
  .global _main
  _main:
      CALL _GetProcAddress
  </code></pre>
  
  <p>using the following commend:</p>
  
  <pre><code>i686-w64-mingw32-gcc -shared -o file.dll file.S
  </code></pre>
  
  <p>but I'm getting the following link error:</p>
  
  <pre><code>`_GetProcAddress' referenced in section `.text' of /tmp/ccamwU4N.o: defined in discarded section `.text' of /usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/lib/../lib/libkernel32.a(dxprbs00553.o)
  </code></pre>
  
  <p>how can I fix this error and call winapi functions?</p>