Not able to load library

1 次查看(过去 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 CenterFile Exchange 中查找有关 Call C from MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by