C名称装饰,如何避免 [英] C-Name Decoration, How to Avoid It
本文介绍了C名称装饰,如何避免的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨.
如何阻止我的编译器(VC5.00)装饰导出的函数名称,并导出它们而不进行装饰.
问候,
:)
Hi.
How do I Stop My compiler (VC5.00) from decorating exported function Names, and export them instead without decoration.
Regards,
:)
推荐答案
您需要在函数名称前添加extern "C"
.
通常,没有名称修饰的导出函数看起来像这样-
You need to prefix the function name withextern "C"
.
Normally an exported function without name mangling would look like this -
extern "C" __declspec(dllexport) int MyFunction(int, int);
导出也可以使用.DEF文件而不是指定__declspec(dllexport)
.
The export could also be done using a .DEF file instead of specifying __declspec(dllexport)
.
完全删除装饰的唯一方法是通过def文件.
The only way to remove decorations completely is through def files.
这篇关于C名称装饰,如何避免的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文