Zulip Chat Archive
Stream: lean4
Topic: importing own files in Lean projects
Anthony Bordg (Jul 12 2024 at 13:38):
Assume I started a project my_project
, using mathlib 4 as a dependency, with two new files my_project/MyProject/fileA.lean
and my_project/MyProject/fileB.lean
, and I want to import fileA in fileB with import MyProject.fileA
.
What has to be done before running the command import MyProject.fileA
properly? I guess the file fileA
should be built, but how? I don't see instructions in the Lean projects section of the Lean Community webpage.
Kevin Buzzard (Jul 12 2024 at 13:39):
It should just work out of the box. What's happening for you?
Kevin Buzzard (Jul 12 2024 at 13:40):
lake build
will by default build every file imported in MyProject.lean
(see mathlib for a huge example of such a file)
Anthony Bordg (Jul 12 2024 at 13:44):
Kevin Buzzard said:
It should just work out of the box. What's happening for you?
I have the following error Imports are out of date and must be rebuilt; use the "Restart File" command in your editor.
.
Ruben Van de Velde (Jul 12 2024 at 13:52):
Follow the instruction :)
Anthony Bordg (Jul 12 2024 at 13:58):
I eventually found the Restart File
command :)
Last updated: May 02 2025 at 03:31 UTC