I tried to call matlab from a .cpp file. I used the following command to compile
engdemo.cpp
which includes \"engine.h\"
g++ engde
The problem is improper specification of include files and folders (i.e. for libraries and link files) and a few additional dependencies.
You can make use of a simple demo code for the interfacing C/C++ and MATLAB is given here, so as to understand what needs to be done.
Also you need to use a CMAKELISTS.TXT file with suitable settings for MATLAB, for which a good tutorial is available here.