You cannot pass a function handle directly to a MEX file generated by MATLAB Coder. Just write a wrapper that calls ode45 in the way you like:
function y = foo(x)
%#codegen
y = ode45(@someFun,...);
and then generate code for foo:
codegen foo -args 1:10