Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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?

Edited by: shui - Jan-29-11 04:29:58

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.

There are 0 guests and 0 other users also viewing this topic
You are here: