2

I have a fresh install of Coq 8.6 in Ubuntu 17.04. When I try to compile my project using make, it works fine until I get the first error message. Then, I try to use CoqIDE to locate and correct the error, but I get new error messages, such as:

"The file foo.vo contains library Top.foo and not library foo"

My guess is that something is wrong with the configuration of CoqIDE, but I do not know what that could be. Any hints?

Thanks in advance, Marcus.

Marcus
  • 437
  • 2
  • 11
  • 3
    Your foo.v was compiled with other flags and paths than those that your CoqIDE uses. Either recompile the files or try to get CoqIDE to use the same flags as were used during the compilation. The relevant flags are the -R, -I and -Q flags, I think. In some cases these flags (which specifies how paths are to be mapped into namespaces) can be set in a `_CoqProject` file, and read automatically into the editor. – larsr May 12 '17 at 06:09

1 Answers1

6

I guess that you are now standing in the directory with the file foo.vo

To map the files in the current dir . into the namespace Top you give the argument

-Q . Top

Here is a "complete" example.

mkdir test; cd test
echo 'Definition a:=1.' > foo.v

coqc -Q . Top foo.v    # this puts the foo module into Top as Top.foo.

coqtop -Q . Top

Coq <  Require Import Top.foo. Print a.

a = 1
     : nat

but using coqtop without mapping the .vo to the namespace into which it was compiled fails:

coqtop

Coq <  Require foo.

> Require foo.
> ^^^^^^^^^^^^
Error: The file /.../test/foo.vo contains library Top.foo
and not library foo
larsr
  • 5,447
  • 19
  • 38
  • Thank you very much. I added a file named _CoqProject to the folder where I have my scripts with the contents -R . Top, and now everything works fine. Nevertheless, I never had to do this in Windows, so I guess this is specific for Linux. – Marcus May 12 '17 at 16:11