Problem loading shared library into MATLAB (64-bit)

2 views (last 30 days)
Dear all,
I have a problem working with an SDK-kit for an EEG recording system.
I have a shared library that I wish to use.
The error message is as shown:
Error using loadlibrary (line 418)
Building mat1_thunk_pcwin64 failed. Compiler output is:
cl -I"D:\Program Files\MATLAB\R2013b\extern\include" /W3 /D_CRT_SECURE_NO_DEPRECATE
/D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0 /nologo -I"C:\Users\Jonas\Documents\MATLAB"
-I"C:\Users\Jonas\Documents\MATLAB\NicoletSDK\MFiles" "mat1_thunk_pcwin64.c" -LD
-Fe"mat1_thunk_pcwin64.dll"
mat1_thunk_pcwin64.c
C:\Users\Jonas\Documents\MATLAB\NicoletSDK\MFiles\MatlabSDK.H(15) : error C2059: syntax error :
'string'
C:\Users\Jonas\Documents\MATLAB\NicoletSDK\MFiles\MatlabSDK.H(17) : error C2059: syntax error :
'string'
C:\Users\Jonas\Documents\MATLAB\NicoletSDK\MFiles\MatlabSDK.H(18) : error C2059: syntax error :
'string'
(above lines repeating)
Error in NicOpen (line 27)
loadlibrary('MatlabSDK.dll','MatlabSDK.h','alias','mat1');
The following is the header file (MatlabSDK.h):
#ifdef MATLABSDK_EXPORTS
#define MATLABSDK_API extern "C" __declspec(dllexport)
#else
#define MATLABSDK_API extern "C" __declspec(dllimport)
#endif
MATLABSDK_API int OpenEx(char* strFileName, int* picSegments);
MATLABSDK_API int GetSegmentTime(double* pdSegmentDuration, double* pdSegmentStartTime);
MATLABSDK_API int GetSegmentInf(int liSegment, double* pdaMaxSampingRate, long* plaSampleCount);
MATLABSDK_API int GetSegment(double dStartTime);
MATLABSDK_API int GetChannelCount(int liSegment);
MATLABSDK_API int GetChannelInf(int liSegment, int liChannel, char* pSensorName);
MATLABSDK_API int GetData(int liSegment, short* plcData);
MATLABSDK_API int GetData2(double dStartTime, double dDuration, short* plcData);
MATLABSDK_API int RecSecToDate(double dRecSec, double* pdDate);
MATLABSDK_API int GetEventCount(long* plcEvents);
MATLABSDK_API int GetEvents(long liEvent, long* plEventTypeID, char* pstrEventTypeDescr, char* pstrEventTypeAbbrevation, char* pstrUserText, double* pdDuration, double* pdTimeStamp);
MATLABSDK_API int Close(void);
As seen, the problem concerns even loading the shared library. I have no experience with C/C++, and I have never seen a header file before. Any help is appreciated.

Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Products

Community Treasure Hunt

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

Start Hunting!