The recommendations in this thread (using WSL, OPAM, and make) are much better for long-term use. But for people on Windows just wanting to work through the book, you can also follow the book’s instructions and manually call coqc on each file as you go. This is discussed in the final section of Basics.v
and in the first section of Induction.v
.
Unfortunately, the instructions are not very clear. So I suspect that many people get to Lists.v
and run into similar issues as OP.
If you are on Windows and installed Coq via the official binary package for Windows (as opposed to the book’s docker image), you will not have make
installed for you. You will however have an application called Coq-shell that was installed alongside CoqIDE.
If you run Coq-shell and navigate (using cd) to the folder where you unzipped the files for Logical Foundations, you will be able to manually run the commands that build the artifacts you need. At the end of the first chapter you need to run:
coqc -Q . LF Basics.v
Doing an equivalent command is necessary at the end of every chapter because each subsequent chapter imports the previous one.
Contrary to the book’s instructions, I haven’t been able to get the menu in CoqIDE to work correctly on a default Windows install, but I can confirm that doing it manually at the command line works.
For the sake of completeness, the command to run the autograder is separate. If you want to do it, you want to run the above command first and then run (separately):
coqc -Q . LF BasicsTest.v
If you try to copy-paste directly from the book, it will put both on the same command line it won’t work.
To be clear: this second command is the only optional step. Building the .v files, via the first command or otherwise, is not optional. Although it is only discussed at the beginning of chapter 2, you need to build each chapter once you reach the end and before starting the next one.