MATLAB: Not able to include files to the .cpp file

mex compiler

Hello
Can some one please help me with this ?
I am trying to include .h files from "/Users/akshayiyangar/Desktop/kinect_home/OpenNI/Include" to my .cpp file
i tried using this command
mex -L"/Users/akshayiyangar/Desktop/kinect_home/OpenNI/Include/" mxNiChangeDepthViewPoint.cpp
but i am getting this error.
Error using mex
/Users/akshayiyangar/Documents/MATLAB/Kinect_Matlab_version2/OpenNI1/Mex/mxNiChangeDepthViewPoint.cpp:3:10:
fatal error: 'XnOpenNI.h' file not found
#include <XnOpenNI.h>
^
1 error generated.

Best Answer

mex -I"/Users/akshayiyangar/Desktop/kinect_home/OpenNI/Include/" mxNiChangeDepthViewPoint.cpp
Use -I to give the directory for Include files. Use -L to give the directory for Libraries