Not able to load library

5 ビュー (過去 30 日間)
Sandeep
Sandeep 2016 年 8 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by