GCC compiling a dll with __stdcall

♀尐吖头ヾ 提交于 2019-12-05 02:58:59

__stdcall decorates the function name by adding an underscore to the start, and the number of bytes of parameters to the end (separated by @).

So, a function:

void __stdcall Foo(int a, int b);

...would become _Foo@8.

If you list the function name (undecorated) in the EXPORTS section of your .DEF file, it is exported undecorated.

Perhaps this is the difference?

Just use -Wl,--kill-at on the gcc command line, which will pass --kill-at to the linker.

References:

You can also use -Wl,--add-stdcall-alias to your linker options in GCC. This will ensure that both function names (decorated and undecorated) are present and can be used as alias.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!