I want to call MATLAB function in my C++ project.
I'm using Matlab R2010a and Visual Studio 2010
First I created a simple matlab function:
function y = foo(x)
y = x+1;
and then I used matlab compiler to compile this function using matlab GUI compiler (File-> new -> Deployment Project and then choose C++ shared Library). It produces this files 2 folders: distrib and src.
distrib contains:
- foo.dll
- foo.h
- foo.lib
src contains :
- foo.cpp
- foo.dll
- foo.exp
- foo.exports
- foo.h
- foo.lib
- foo_mcc_component_data.c
I want to use this file in a C++ application. I tried many times and I didn't find a way. All the ways I found over the internet are using old matlab compiler which produces different files or works on an old version of visual studio.
So please could anyone help me?
What must I do? What files/references must I add and to where? What paths must I define?