In order to be able to use MATLAB C/C++ Math Library functions in your c++ code you have to setup you compiler
In your project setteings you should do following
1) add lib files to your project settings under link bookmark
Go to MATLAB help
Using the C++ Math Library: Getting Started: Linking...