I am using codegen
in MATLAB R2016b to generate a .dll file as follows:
codegen -config:dll ex_fun.m -args {0,0,0,0,0,0}
I have tried to include the dll file as a reference using Visual Studio 2015 but nothing works fine and I couldn't use the .lib file as a linker eitherll.
The strange thing is that I could easily use gcc
on Linux by compiling the .c script that calls the C function along with the output .so file (which is equivalent to .dll in windows) as follows:
gcc main.c ex_fun.so -Wl,-rpath=$(pwd)
However, I couldn't find any direct method in Windows. How can I use and call a .dll file output by MATLAB in a C main script program?
It should be noted that a .def file is also generated but I don't how to use it along with the output dll file.