I created a quick Measurement Studio test project and added the following function in my dialog source file:
static double FitModelFunction(double x, double coef[], int size)
{
return 0.0;
}
I then called CNiMath::NonLinearFit like this:
CNiReal64Vector x, y, z, coef;
double mse;
// ...
CNiMath::NonLinearFit(x, y, FitModelFunction, z, coef, mse, -1);
This built OK for me. Is this different than what you were doing? If this doesn't help, could you please post some sample code that demonstrates how you're declaring the callback function and specifying it to NonLinearFit? Thanks.
- Elton