2015-07-11 357 views
2

我安裝了OCaml庫。爲了證明我有這個:爲什麼ocamlfind無法找到已安裝的庫(camlp4)

$ ~/.opam/bin/opam install camlp4 
[NOTE] Package camlp4 is already installed (current version is 4.02+system). 

這:

$ ls `ocamlc -where`/camlp4* 
Camlp4.cmi  Camlp4Bin.cmx Camlp4Parsers Camlp4Top.cmi  camlp4fulllib.a  camlp4lib.a  camlp4o.cma camlp4orf.cma camlp4prof.cmx camlp4rf.cma 
Camlp4Bin.cmi Camlp4Bin.o Camlp4Printers Camlp4Top.cmo  camlp4fulllib.cma camlp4lib.cma camlp4of.cma camlp4prof.cmi camlp4prof.o 
Camlp4Bin.cmo Camlp4Filters Camlp4Top  Camlp4_config.cmi camlp4fulllib.cmxa camlp4lib.cmxa camlp4oof.cma camlp4prof.cmo camlp4r.cma 

但是當我嘗試這一點,它無法識別該文件

$ ocamlfind query camlp4 
ocamlfind: Package `camlp4' not found 

如何啓用它?

~/.ocamlinit看起來是這樣的:

let() = 
    try Topdirs.dir_directory (Sys.getenv "OCAML_TOPLEVEL_PATH") 
    with Not_found ->() 
;; 
#use "topfind";; 
+0

'〜/ .ocamlinit'是頂層ocaml執行的初始文件,與ocamlfind無關'。 – ChriS

回答

1

機會是很好的,你忘了

eval $(opam config env) 

命令用來激活OPAM enviromnment。並且您正在嘗試使用系統編譯器進行編譯,即系統軟件包管理器安裝的編譯器

相關問題