对不起菜鸟问题。我正在尝试学习如何在 Modelica 模型中集成 C 函数。我无法理解如何指定外部函数的路径。
我创建了一个外部 C 函数并保存在与我的模型目录或工作目录不同的目录中。我认为使用 IncludeDirectory 注释可以让我引用 C 函数所在的位置,但我无法让它工作。
impure function computeHeat "Modelica wrapper for an embedded C function controller"
input Real T;
input Real Tbar;
input Real Q;
output Real heat;
external "C"annotation(Include="#include<ComputeHeat.c>",IncludeDirectory="E:/temp/source_C");
end computeHeat;
当我尝试编译演示示例模型时,我收到以下消息。
编译器消息:
编译和链接模型 (Visual C++)。
dsmodel.c dsmodel.c(10):致命错误 C1083:无法打开包含文件:'ComputeHeat.c':没有这样的文件或目录
生成 Dymosim 时出错。