我想使用dllexport导出函数。但是我在编译"error C4439:'WrappedC‘:function definition with a managed type in the signature必须具有__clrcall调用约定“时遇到错误。
我在头文件(.h)中的代码是:
extern "C"
{
__declspec(dllexport) int __stdcall ABC(int i);
__declspec(dllexport) char* __stdcall C(int i);
__declspec(dllexport) array<char>^ __stdcall WrappedC(int i) ;
}我曾尝试将_stdcall更改为__clrcall,但它出现了另一个错误:
error C3395: 'WrappedC' : __declspec(dllexport) cannot be applied to a function with the __clrcall calling convention我已经在网上搜索过了,但还没有解决。
谢谢,
T&T组
发布于 2012-03-16 10:35:20
编译器已经很好地告诉你问题出在哪里了。
__declspec(dllexport) array<char>^ __stdcall WrappedC(int i)由于该函数使用的是clr,因此不能使用__declspec(dllexport)。
array<char>^几乎就是它抱怨的部分,因为它不是本机代码。
https://stackoverflow.com/questions/9730951
复制相似问题