GCC使用__stdcall编译dll [英] GCC compiling a dll with __stdcall

查看:185
本文介绍了GCC使用__stdcall编译dll的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我们使用__stdcall在visual studio 2008中编译一个dll时,dll中编译的函数名是。



FunctionName



虽然当我们使用gcc使用wx-dev-cpp编译同样的dll GCC追加函数具有的参数的数量,所以使用Dependency walker的函数名称如下。



FunctionName @ numberOfParameters或== FunctionName @ 8



如何告诉GCC编译器从dll中导出的符号中删除@nn?

解决方案

__ stdcall通过在开始处添加下划线来装饰函数名,并将参数的字节数添加到结尾(用@



所以,一个函数:

  void __stdcall Foo a,int b); 

...将成为_Foo @ 8。



如果您在.DEF文件的EXPORTS部分中列出函数名(未装饰),则会导出未装饰的。



p>

When we compile a dll using __stdcall inside visual studio 2008 the compiled function names inside the dll are.

FunctionName

Though when we compile the same dll using GCC using wx-dev-cpp GCC appends the number of paramers the function has, so the name of the function using Dependency walker looks like.

FunctionName@numberOfParameters or == FunctionName@8

How do you tell GCC compiler to remove @nn from exported symbols in the dll?

解决方案

__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?

这篇关于GCC使用__stdcall编译dll的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆