Hi,
I tried the ExternalLibraries example from the User Guide in the testmodels
directory of the 1.4.4 release.
It worked fine.
Then I wanted to change one function to take no arguments. That didn't work.
Did I do something wrong or is this a bug? Description follows.
Regards,
Alexander
I changed ExternalFunc1_ext() to take no arguments. Changed all the signatures
and implementations. Like in the C file:
double ExternalFunc1_ext()
{
return 2;
}
And in the model:
function ExternalFunc1
output Real y;
external y=ExternalFunc1_ext()
annotation(Library="libExternalFunc1_ext.o",
Include="#include\"ExternalFunc1_ext.h\"");
end ExternalFunc1;
With a later call to:
der(x)=-ExternalFunc1();
Running the script gives off:
>> runScript("ExternalLibraries.mos")
"true
0
0
record
resultFile = "Simulation failed.
No matching function found for ExternalFunc1() of type function() =>
Real, candidates are function() => Real
Error occured while flattening model ExternalLibraries
"
end record
true"