Question removed. I was using mex instead of nvmex which caused some problems while compiling under matlab.
Y.