- 论坛徽章:
- 0
|
最近要写一个DLL,想用MINGW写,问题是!
函数如果使用__stdcall 的方式导出则会出现function@4 (数字是占用的字节数好像是)
而如果用__codel的方式导出就不会有这个问题
函数的代码- /*
- * This is a dll for test
- * Compile : gcc -mwindows -shared test.c -o test.dll
- */
- /* define __CYGWIN__ for cancel include winsock2.h */
- #define __CYGWIN__
- #include <stdio.h>
- #include <windows.h>
- typedef unsigned long u_long;
- u_long
- __stdcall testexport(u_long hostlong)
- {
- MessageBox(0, "这是我想显示的字", "这是标题", 0);
- return 0;
- }
复制代码 函数名称会变成
testexport@4
mingw版本
MinGW 5.1.6
Thread model: win32
gcc version 3.4.5 (mingw-vista special r3)
操作系统版本
xp sp3
已经在网上搜索了很多方法
帖子刚写完,方法就找到了。。。。
添加参数
-Wl,--kill-at
郁闷ing..... |
|