我有以下代码,我试图从我的DLL导出一个名为"Interface_API"的函数.
#ifdef INTERFACEDLL_EXPORTS
#define UserApp_API __declspec(dllexport);
#else
#define UserApp_API __declspec(dllimport);
#endif
UserApp_API int Interface_API(int *, int *, int *);
Run Code Online (Sandbox Code Playgroud)
当我编译此代码时,它会发出以下警告,并且该函数未导出.
warning C4091: ' __declspec(dllexport)' : ignored on left of 'int' when no variable is declared
Run Code Online (Sandbox Code Playgroud)
当我更改下面给出的声明时,我没有得到警告,它正确导出.
__declspec(dllexport) int Interface_API(int *, int *, int *);
Run Code Online (Sandbox Code Playgroud)
我有点困惑,因为我已经在不同的DLL中使用它,它工作正常.任何线索?
| 归档时间: |
|
| 查看次数: |
2999 次 |
| 最近记录: |