This is definitely a compiler issue... mingw and visualstudio handle calling conventions differently, and you may have toggled a switch in either by compiling it as C++ when it shouldve been C or vice versa.