Not able to load library
5 ビュー (過去 30 日間)
古いコメントを表示
I am not able to load library when the header file contains a structure with a member variable an array of Enum.
So basically i have a header file like below
#include "stdio.h"
#include "string.h"
typedef enum {
tester = 0
} tester_te;
typedef struct {
tester_te param[4];
} test_ts;
__declspec(dllexport) int initTest (test_ts *inp_s);
and a source file like below:
#include "libfile.h"
void __stdcall _DllMainCRTStartup(void* hinstDLL, unsigned long fdwReason, void* lpReserved)
{
}
int initTest (test_ts *inp_s)
{
int retValue = 1;
//ImplJystk_Ini(&ImplJystk_s);
retValue = 0;
return retValue;
}
Now i have created a library using the nmake command and have the .dll & .lib file. Next i try to load the library to matlab like below:
[notfound, warnings] = loadlibrary('libfile', 'libfile.h', 'includepath', 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\include'...
, 'includepath', 'C:\Program Files\Microsoft SDKs\Windows\v7.1\Include'...
);
But i recieve an error in matlab saying:
Warning: The data type 'tester_te#4' used by structure test_ts does not exist. The structure may not be usable.
> In loadlibrary
Now if i try removing the array in the header file (param[4] to param), the loadlibrary function works without any errors.
Any idea why the first one doesn't work?
0 件のコメント
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!