我试图安装tcoq,并出现了以下错误:
"/Users/pinocchio/.opam/4.05.0/bin/ocamlfind" ocamlc -rectypes -w -3-52-56 -c grammar/compat5.ml
OCAMLC -c -pp grammar/gramCompat.mlp
>> Fatal error: OCaml and preprocessor have incompatible versions
Fatal error: exception Misc.Fatal_error
make[1]: *** [grammar/gramCompat.cmo] Error 2
make: *** [submake] Error 2有没有人知道:
我在网上看到了相关的帖子:
https://coq-club.inria.narkive.com/h4i0KOH0/problem-compiling-coq
但这并不是很有帮助。我做了:
ocaml -I +camlp5就像他们说的,而且看起来还不错.
我确实做过make clean,但这没有帮助。
我刚刚意识到,我跳过了安装的第3步,但是如果它与问题有关,或者我应该如何处理它,我会进行如下操作:
3- The uncompression and un-tarring of the distribution file gave birth
to a directory named "coq-8.xx". You can rename this directory and put
it wherever you want. Just keep in mind that you will need some spare
space during the compilation (reckon on about 300 Mb of disk space
for the whole system in native-code compilation). Once installed, the
binaries take about 30 Mb, and the library about 200 Mb.我正在尝试安装游戏垫,要做到这一点,需要遵循说明。特别是,我运行了以下3个命令:
opam switch 4.05.0
opam install camlp4
opam install ocamlfind当前的大多数错误:
make
/Library/Developer/CommandLineTools/usr/bin/make --warn-undefined-variable --no-builtin-rules -f Makefile.build
OCAMLC -c -pp grammar/gramCompat.mlp
>> Fatal error: OCaml and preprocessor have incompatible versions
Fatal error: exception Misc.Fatal_error
make[1]: *** [grammar/gramCompat.cmo] Error 2
make: *** [submake] Error 2在阅读了这个错误之后,我奇迹般地想到了打印ocaml和camlp5的版本。
$ camlp5 -v
Camlp5 version 7.07 (ocaml 4.07.0)以及:
ocaml
OCaml version 4.05.0因此,显然这是错误的,所以也许第一步是修复camlp5以使用4.05.0,因为这是我所需要的。
我试着卸载camlp5,但是它拒绝了!
brew uninstall camlp5
Error: Refusing to uninstall /usr/local/Cellar/camlp5/7.07
because it is required by coq, which is currently installed.
You can override this and force removal with:
brew uninstall --ignore-dependencies camlp5发布于 2018-12-28 12:01:18
看来你已经搞清楚错误的意思了。本地OCaml可执行文件针对的camlp5版本与通过opam使用的OCaml版本不同。让我直接转到你问题的第二部分。
这里的主要问题来自这样一个事实:对于OCaml包,您使用两个不同的源,即包管理器(例如brew)和opam。为了解决您的问题,您应该只从一个源安装这些包。我推荐opam,因为它允许您通过交换机轻松地管理不同的OCaml版本。
只需卸载本地版本的camlp5,例如,
brew uninstall camlp5然后使用opam安装它
opam install camlp5此建议也适用于其他OCaml包,如ocamlbuild、camlp4等。
https://stackoverflow.com/questions/53926584
复制相似问题