Not able to load library
5 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (0)
Ver también
Categorías
Más información sobre Matrix Indexing en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!