gcc去掉dll导出函数多余的符号

来源:互联网 发布:怎么看淘宝店 编辑:程序博客网 时间:2024/05/17 22:54
适用于codeblcoks

经过试验,创建动态库, 如果所有函数都没有加__declspec(dllexport)和__stdcall,则所有的函数都以原名导出,如果加了__declspec(dllexport)和__stdcall,则只有加了__declspec(dllexport)的会导出,同时加了__stdcall会出现符号@n,在链接选项中加入下面选项解决。


参考:

So for anyone else looking to build a dll using the __stdcall (WINAPI) calling convention, without the name decoration MinGW (GCC) adds, then put this in CodeBlocks' "Other Linker Options":

-Wl,--kill-at


Build DLLs with MinGW(--kill-at) 
http://blog.csdn.net/huys03/article/details/3912475
0 0
原创粉丝点击