使用dllexport时出错
Error when using dllexport?
我想使用dllexport导出函数。但我在编译器"错误C4439:'WrappedC':签名中具有托管类型的函数定义必须具有__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组
编译器已经告诉你问题出在哪里了
__declspec(dllexport) array<char>^ __stdcall WrappedC(int i)
不能使用__declspec(dllexport)
,因为该函数正在使用clr
。
array<char>^
几乎是它抱怨的部分,因为它不是本机代码。
相关文章:
- 访问者访问变体并返回不同类型时出错
- 在Linux for Windows上编译C++代码时出错
- 读取文件的最后一行并输入到链接列表时出错
- 重载操作程序时出错>>用于类中的字符串 memebr
- 调用专用模板时出错"no matching function for call to [...]"
- C++-试图将函数指针推回到另一个CPP文件中的矢量时出错
- LINK 尝试使用 OpenSSL evp aes 256 c++ 时出错
- 在Google Kick start中提交时出错
- 在c++中访问int到类对象的映射时出错
- 分段错误当我试图运行程序时出错
- 使用dynamic_cast和构造函数时出错
- CHECK(调用)函数在Google Colab中出错
- 用pybind11包装C++抽象类时出错
- 为x86而非x64编译时出错
- 从R调用C++函数并对其进行集成时出错
- 这个函数哪里出错了
- C++ 创建包含链表和字符串的对象的链接列表时出错
- 为重写std::exception的库生成swig接口时出错
- 导入/导出变量时出错
- 使用dllexport时出错