- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » where does 'import' look for packages
where does 'import' look for packages
where does 'import' look for packages
In a directory i put a model file (Apollo12a.mo).
In a subdirectory named 'Core' i put the package files. package.mo, Body.mo, CelestialBody.mo, Rocket.mo.
In de file Apollo12a.mo i put the import Core; statement.
When i run the command 'omc Moonlanding.mos' i get the error message 'Class Core.CelestialBody not found'.
----
mos file:
loadFile("Moonlanding.mo");
simulate(MoonLanding, stopTime=230);
plot({apollo.altitude,apollo.thrust});
----
package file in the Core directory
------
within ;
encapsulated package Core "Contains the Core classes and models"
end Core;
------
Q: Where does omc look for the 'import Core' statement.
Re: where does 'import' look for packages
Hi,
Read more here:
https://modelica.org/documents/ModelicaSpec33.pdf
Chapter 13: Packages
Cheers,
Adrian Pop/
- adrpo
- 885 Posts
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » where does 'import' look for packages