Looks like this is not possible:
"Caution The C++ shared library interface does not support varargin with zero (0) input arguments. Calling your program using an empty mwArray results in the compiled library receiving an empty array with nargin = 1. The C shared library interface allows you to call mlfFOO(NULL) (the compiled MATLAB code interprets this as nargin=0). However, calling FOO((mwArray)NULL) with the C++ shared library interface causes the compiled MATLAB code to see an empty array as the first input and interprets nargin=1."