I have a C++ header file and the corresponding static library (.lib file). No source file. The code comprises several classes, each with functions of its own.
I would like to be able to call these functions from MATLAB.
Would anyone be kind enough to point me in the right direction? Examples would be appreciated.
Thanks.
EDIT: Would it be a good idea to write a DLL to act as an interface between the static library and MATLAB? Then I can access the functions in my static library from the DLL and use calllib to access the DLL from MATLAB. If so, how would I call the class member functions in the static library from a DLL?
Update
So I've decided to write a DLL to which I will link the static library and call the functions from MATLAB through that using calllib
The problem is, the static library is already compiled and I do not have the source. I try to link the .lib file (presumably built using Visual Studio) and build my DLL using MINGW32 but this doesn't work possibly due to (lack of?) interoperability of libraries created by different compilers.
This is the MinGW command I use to link: g++ -c -o -DBUILDING_INTERMEDIATE_DLL intermediate_dll.cpp -TaccClient.lib
intermediate_dll.cpp is the source file for my DLL and TaccClient.lib is the static library I'm using.
Does anyone have any suggestions as to how this could work, or will I have to wait and try it on visual studio later?