title: MinGW and @N dll functions linking
body: <p>I have the '.h' file with content like this:</p>
  
  <pre><code>#ifndef MY_IMPORT
      #define MY_IMPORT __declspec(dllimport) /* !!! */
  #endif
  
  #ifndef MY_EXPORT
      #define MY_EXPORT __declspec(dllexport)
  #endif
  
  #ifdef __cplusplus
      extern "C"{
  #endif
  
  MY_IMPORT VOID* WINAPI XXX_FUNC( VOID * ARG1, ... );
  
  /* ... */
  
  #ifdef __cplusplus
  }
  #endif
  </code></pre>
  
  <p>and I have the 'lib.dll' library, which exports XXX_FUNC without @N suffix.</p>
  
  <p>When I try to build my dll (mydll.dll) wich uses this lib.dll I have got GCC message:</p>
  
  <pre><code>undefined reference to `__imp__XXX_FUNC@12'
  </code></pre>
  
  <p>I looked many tons of internet, including stackoverflow but I can't find the solution.
  Linker called as:</p>
  
  <pre><code>g++ -shared -Wl,--enable-stdcall-fixup mydll.o -L. lib.dll -o mydll.dll 
  </code></pre>
  
  <p>As I can find, the GCC must try to link the '_<em>imp</em>_XXX_FUNC@12' to '_<em>imp</em>_XXX_FUNC', and '--enable-stdcall-fixup' is only option that prevents warnings on such conditions, but my MinGW GCC don't try this. </p>
  
  <p>I have installed MinGW with GCC v4.7.</p>