私はmatlabでclllib関数を使用しようとしています.dllファイルと.hファイルを開発中の.m MATLABファイルと同じディレクトリに置き、その後loadlibrary関数buiを使用しようとしましたが、いくつかの警告があります
警告:
Warning:
Message from C preprocessor:
lcc preprocessor error: C:\Users\MAHNAZ\Documents\MATLAB\T1Header.h:1 Could not find include file
<iostream>
lcc preprocessor warning: C:\Users\MAHNAZ\Documents\MATLAB\T1Header.h:21 EOF inside comment
> In loadlibrary at 351
Warning: The function 'Add' was not found in the library
> In loadlibrary at 435
Warning: The function 'Function' was not found in the library
> In loadlibrary at 435
calllib
次のような関数を使用したい場合: calllib('t1', 'Add', 2,3)
matlab でエラーが発生します:
??? Error using ==> calllib Method was not found.
私のヘッダーファイルは次のとおりです。
#ifndef T1_HEADER_H
#define T1_HEADER_H
extern int Add( int a, int b );
extern void Function( void );
#endif
私のソースファイルは次のとおりです。
#include iostream
#include "T1Header.h"
extern int Add( int a, int b )
{
return( a + b );
}
extern void Function( void )
{
std::cout << "DLL Called!" << std::endl;
}
Visual C++ 2010 と Matlab 7.6.0(R2008a) を使用しています。
何が間違っているか、このエラーを修正するために何ができるか、または MATLAB 内からこの .dll を呼び出すために他に何ができるかについての提案はありますか?