You are getting this error because Scalar::all
is not a type (unlike Scalar
). Just removing the new
would not work because Scalar::all
returns an instance of Scalar with local storage.
Most likely want you want is:
Scalar* cv_create_ScalarAll(double val)
{
return new Scalar(Scalar::all(val));
}