I have a dll, it exports a function ...
extern "C" int __stdcall MP_GetFactory( gmpi::IMpUnknown** returnInterface ) { }
I am compiling this using the Code :: Blocks GCC compiler (V3.4.5). Problem: as a result, the dll exports the decorated function name ...
MP_GetFactory@4
This does not load, it should just be old ...
MP_GetFactory
I investigated this for about 4 hours. I think -add-stdcall-alias is an opportunity to fix this. My code :: Log Lock ...
mingw32-g ++. exe -shared -Wl, -out-implib = bin \ Debug \ libGainGCC.a -Wl, - dll obj \ Debug \ se_sdk3 \ mp_sdk_audio.o obj \ Debug \ se_sdk3 \ mp_sdk_common.o obj \ Debug \ Gain \ Gain.o obj \ Debug \ Gain \ gain.res -o bin \ Debug \ GainGCC.sem --add-stdcall-alias -luser32
.. so I think the right option is there? But no luck. Dependancy Walker shows only the exported name. I got it to work using __cdecl instead of __stdcall, then the name is then exported normally, but the function corrupts the stack on the call (since the caller was expecting another calling convention).
source share