title: Warning: resolving Func by linking to Func@##
body: <p>I'm building a DLL with the following:</p>
  
  <pre><code>extern "C" __declspec(dllexport) void __stdcall DrawMouse(int X, int Y, int R, int G, int B)
  {
      Buffer.SetMouse(X, Y, R, G, B);
  }
  </code></pre>
  
  <p>Then in a .def file I added:</p>
  
  <pre><code>LIBRARY Test
  ;DESCRIPTION "Test Definition File"
  EXPORTS
  
  DrawMouse;
  </code></pre>
  
  <p>Then when I compile, I add the linker options:</p>
  
  <pre><code>-static
  -static-libstdc++
  -static-libgcc
  -Wl,--kill-at -d --input-def src\Test.def
  -m32
  </code></pre>
  
  <p>And the output is:</p>
  
  <blockquote>
    <p>Warning: Resolving _DrawMouse by linking to _DrawMouse@24</p>
  </blockquote>
  
  <p>Why? Why does it warn me about resolving and how can I get rid of it? For a large amount of exports, I get a large amount of warning..</p>
  
  <p><strong>Small Example:</strong></p>
  
  <p>Main.cpp:</p>
  
  <pre><code>#include &lt;windows.h&gt;
  
  class Input
  {
      public:
          void SetMouse(int X, int Y, int R, int G, int B)
          {
              /**Dummy Example**/
          }
  };
  
  
  
  Input Buffer;
  extern "C" void __stdcall SetMouse2(int X, int Y, int R, int G, int B)
  {
      /**Dummy Non-Class Example**/
  }
  
  extern "C" __declspec(dllexport) void __stdcall DrawMouse(int X, int Y, int R, int G, int B)
  {
      Buffer.SetMouse(X, Y, R, G, B);
  }
  
  extern "C" __declspec(dllexport) void __stdcall DrawMouse2(int X, int Y, int R, int G, int B)
  {
      SetMouse2(X, Y, R, G, B);
  }
  
  extern "C" __declspec(dllexport) bool __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
  {
      switch (fdwReason)
      {
          case DLL_PROCESS_ATTACH:
              DrawMouse(100, 100, 1, 1, 1);
              DrawMouse2(100, 100, 1, 1, 1);
              break;
  
          case DLL_PROCESS_DETACH:
              break;
      }
      return true;
  }
  </code></pre>
  
  <p>Test.def:</p>
  
  <pre><code>LIBRARY Test
  ;DESCRIPTION "Test Definition File"
  EXPORTS
  
  DrawMouse;
  DrawMouse2;
  </code></pre>
  
  <p>Compiler Log:</p>
  
  <pre><code>-------------- Clean: Release in Test (compiler: GNU GCC Compiler)---------------
  
  Cleaned "Test - Release"
  
  -------------- Build: Release in Test (compiler: GNU GCC Compiler)---------------
  
  x86_64-w64-mingw32-g++.exe  -O2  -Wall -m32 -DBUILD_DLL  -std=c++11    -c C:\Users\Brandon\Desktop\Test\main.cpp -o obj\Release\main.o
  
  x86_64-w64-mingw32-g++.exe -shared -Wl,--output-def=bin\Release\libTest.def -Wl,--out-implib=bin\Release\libTest.a -Wl,--dll  obj\Release\main.o   -o bin\Release\Test.dll -s -static -static-libstdc++ -static-libgcc -Wl,--kill-at -d --input-def Test.def -m32  -luser32 
  
  Warning: resolving _DrawMouse by linking to _DrawMouse@20
  Warning: resolving _DrawMouse2 by linking to _DrawMouse2@20
  Use --enable-stdcall-fixup to disable these warnings
  Use --disable-stdcall-fixup to disable these fixups
  
  Output size is 32.50 KB
  Process terminated with status 0 (0 minutes, 0 seconds)
  0 errors, 2 warnings (0 minutes, 0 seconds)
  </code></pre>
  
  <p>NOTE: --disable-stdcall-fixup does NOT work. Which is why I am asking how to fix this and get rid of these warnings as well as what causes them.</p>
  
  <p><strong>EDIT:</strong> </p>
  
  <p>Command line with the fixups as requested:</p>
  
  <pre><code>x86_64-w64-mingw32-g++.exe  -O2  -Wall -m32 -DBUILD_DLL  -std=c++11    -c C:\Users\Brandon\Desktop\Test\main.cpp -o obj\Release\main.o
  
  x86_64-w64-mingw32-g++.exe -shared -Wl,--output-def=bin\Release\libTest.def -Wl,--out-implib=bin\Release\libTest.a -Wl,--dll  obj\Release\main.o   -o bin\Release\Test.dll -s -static -static-libstdc++ -static-libgcc -Wl,--kill-at -d --input-def Test.def -m32 --disable-stdcall-fixup  -luser32 
  </code></pre>
  
  <p>Also tried:</p>
  
  <pre><code>x86_64-w64-mingw32-g++.exe  -O2  -Wall -m32 -DBUILD_DLL  -std=c++11    -c C:\Users\Brandon\Desktop\Test\main.cpp -o obj\Release\main.o
  
  x86_64-w64-mingw32-g++.exe -shared -Wl,--output-def=bin\Release\libTest.def -Wl,--out-implib=bin\Release\libTest.a -Wl,--dll  obj\Release\main.o   -o bin\Release\Test.dll -s -static -static-libstdc++ -static-libgcc -Wl,--kill-at -d --input-def Test.def -m32 --enable-stdcall-fixup  -luser32 
  </code></pre>
  
  <p>Neither works.</p>