- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Usage of external C-Functions
Usage of external C-Functions
Usage of external C-Functions
Consider calling an external function like
Code:
myextfunc(myparam) annotation(Library="mylib.a",
Include="#include \"mylib.h\"",
IncludeDirectory="modelica://MyModelicaPackage/Resources/include",
LibraryDirectory="modelica://MyModelicaPackage/Resources/lib");
//"C"
It works if mylib.a and mylib.h are located in the current working directory, whilst "IncludeDirectory" and "LibraryDirectory" do not have an effect on the generated makefile.
Is the usage of this annotations not yet implemented or did i use it wrong?
Re: Usage of external C-Functions
Why do you need to add the include? It really is quite unnecessary in OpenModelica (except to check if your external function is defined differently from the way OpenModelica assumes it is).
IncludeDirectory and LibraryDirectory are Modelica 3.2-specific (which we have not implemented). In fact, modelica:// is not present anywhere in our source code.
- sjoelund.se
- 1700 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Usage of external C-Functions