用vs2019編譯生成的dll,在vs2019控制臺程式中測驗正常,代碼如下:頭檔案:
#ifndef DH_H
#define DH_H
#ifdef _cplusplus
extern "C" {
#endif // _cplusplus
_declspec(dllexport) int add(int a, int b);
#ifdef _cplusplus
}
#endif // _cplusplus
#endif // !DH_H
程式檔案:
#include "Dh.h"
int add(int a, int b)
{
return (a + b);
}
使用MATLAB呼叫后:
>> loadlibrary('D1','Dh.h')
>> libfunctions D1 -full
沒有 lib.D1 類的方法。
為什么說沒有類的方法?請教!
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/269699.html
標籤:其他開發語言
上一篇:python執行緒互斥鎖
