简体   繁体   English

编译失败:ocamlfind: Package `xmlm' not found

[英]Failde to compile : ocamlfind: Package `xmlm' not found

I am trying to compile an OCaml .ml file with make command via command line remote machine but it shows me this error:我正在尝试通过命令行远程机器使用make命令编译 OCaml .ml文件,但它向我显示此错误:

+ ocamlfind ocamlc -c -package xmlm -package unix -o pms.cmo pms.ml
ocamlfind: Package `xmlm' not found
Command exited with code 2.
Hint: Recursive traversal of subdirectories was not enabled for this build,
  as the working directory does not look like an ocamlbuild project (no
  '_tags' or 'myocamlbuild.ml' file). If you have modules in subdirectories,
  you should add the option "-r" or create an empty '_tags' file.
  
  To enable recursive traversal for some subdirectories only, you can use the
  following '_tags' file:
  
      true: -traverse
      <dir1> or <dir2>: traverse
      
Compilation unsuccessful after building 6 targets (5 cached) in 00:00:00.
Makefile:10 : la recette pour la cible « native » a échouée
make: *** [native] Erreur 10

I tried to export the environment with this command:我尝试使用以下命令导出环境:

eval $(/usr/bin/opam config env --root=/path/Ocaml/opam-ocaml-4.04-strech)

But also I had this error:但我也有这个错误:

# opam-version    1.2.2
# os              linux
File /p/opas/src/Ocaml/opam-ocaml-4.04-strech/config does not exist

while the config file does exist in the directoryconfig文件确实存在于目录中

any help Please?!!有什么帮助吗?! Thank you谢谢

To make a package available via opam (assuming that opam is properly installed and configured) you need to:要通过 opam 使 package 可用(假设 opam 已正确安装和配置),您需要:

  1. install the package安装 package
  2. activate your opam激活你的 opam

To install a package named foo, execute the following command in your shell要安装名为 foo 的 package,请在 shell 中执行以下命令

opam install foo

To activate your opam installation (which enables the search paths), issue the following command要激活您的 opam 安装(启用搜索路径),请发出以下命令

eval $(opam config env)

or, with modern opam (that is of version 2.x) just eval $(opam env)或者,使用现代 opam(即版本 2.x)只需eval $(opam env)

Before doing this, you need to properly initialize your opam installation, ie, to install the compiler (or use the system compiler) and the base packages.在此之前,您需要正确初始化您的 opam 安装,即安装编译器(或使用系统编译器)和基础包。 This is done via the opam init command that creates an opam-managed subdirectory in your home, eg, using an (old by today's standards) OCaml version 4.04.0, you can initialize it like this这是通过opam init命令完成的,该命令在您的家中创建一个由 opam 管理的子目录,例如,使用(按照今天的标准旧的)OCaml 版本 4.04.0,您可以像这样初始化它

opam init --comp=4.04.0

once the initialization is finished, do not forget to activate it via eval $(opam config env) and now you can install the package.初始化完成后,不要忘记通过eval $(opam config env)激活它,现在您可以安装 package。

Finally, the version of opam that you're using is outdated and long ago deprecated, thus it is not receiving updates and the repositories that this version can understand are frozen and no longer updated.最后,您使用的opam版本已经过时并且很久以前就被弃用了,因此它没有接收更新,并且该版本可以理解的存储库被冻结并且不再更新。 You really need to update your opam to a 2.x version.您确实需要将 opam 更新到 2.x 版本。 Please follow the opam installation instructions to get the latest version.请按照opam 安装说明获取最新版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM