- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » How to properly use the "uses"...
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
- Arinomo23
- 120 Posts
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.
- perost
- 114 Posts
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)
- Arinomo23
- 120 Posts
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).
- perost
- 114 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » How to properly use the "uses"...