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

How to properly use the "uses" annotation

How to properly use the "uses" annotation

Say i have a directory named Library and inside it there were the directories Lib_A, Lib_B (each with package.mo inside) and model_1.mo

Code:


package Lib_A
annotation(version="1.0.0");
end Lib_A

Code:


package Lib_B
annotation(uses(Lib_A(version="1.0.0"));
end Lib_A

and

Code:


model model_1
annotation(uses(Lib_A(version="1.0.0"));
end Lib_A

opening Lib_B will automatically loads Lib_A but not when opening model_1.

Why is the dependency frorm one package to other (in the same path) could be reolved but not between model and package?

OM version 1.14

cheers

Re: How to properly use the "uses" annotation

Loading model_1 also loads Lib_A for me, assuming the Library-folder is in the MODELICAPATH. But 1.14 is very old so it might be something that has been fixed since, I suggest you try the latest release instead.

Re: How to properly use the "uses" annotation

Hi perost,

Ok, i'll try it on the nightly build. But that means, I have to include the path to Library on OPENMODELICALIBRARY env variable? (i'm using window)

Re: How to properly use the "uses" annotation

Arinomo23 wrote:


Hi perost,

Ok, i'll try it on the nightly build. But that means, I have to include the path to Library on OPENMODELICALIBRARY env variable? (i'm using window)

In OMEdit you can also add user libraries in Options->Libraries, or just put the libraries in one of the default paths (you should get a message saying which folders where searched if it can't find a library).

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