当我尝试使用安装时ocamlfind
,opam install ocamlfind
编译失败并给出以下消息:
#=== ERROR while installing ocamlfind.1.5.5 ===================================#
# opam-version 1.2.0
# os darwin
# command make all
# path /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5
# compiler system (4.02.1)
# exit-code 2
# env-file /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5/ocamlfind-21707-c61e7b.env
# stdout-file /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5/ocamlfind-21707-c61e7b.out
# stderr-file /Users/MTGAP/.opam/system/build/ocamlfind.1.5.5/ocamlfind-21707-c61e7b.err
### stdout ###
# ...[truncated]
# ocamlc -I +compiler-libs -c fl_package_base.mli
# ocamlc -I +compiler-libs -g -c fl_package_base.ml
# ocamlc -I +compiler-libs -c findlib.mli
# ocamlc -I +compiler-libs -g -c findlib.ml
# ocamlc -I +compiler-libs -g -c fl_args.ml
# ocamlc -I +compiler-libs -a -o findlib.cma findlib_config.cmo fl_split.cmo fl_metatoken.cmo fl_meta.cmo fl_metascanner.cmo fl_topo.cmo fl_package_base.cmo findlib.cmo fl_args.cmo
# ocamlc -I +compiler-libs -g -c ocaml_args.ml
# ocamlc -I +compiler-libs -g -c frontend.ml
# ocamlc -I +compiler-libs -custom -o ocamlfind -g findlib.cma unix.cma \
# ocaml_args.cmo frontend.cmo
### stderr ###
# ...[truncated]
# Undefined symbols for architecture x86_64:
# "start", referenced from:
# implicit entry/start for main executable
# (maybe you meant: _caml_heap_start, _caml_young_start , _caml_start_code , _caml_startup_code )
# ld: symbol(s) not found for architecture x86_64
# clang: error: linker command failed with exit code 1 (use -v to see invocation)
# File "_none_", line 1:
# Error: Error while building custom runtime system
# make[1]: *** [ocamlfind] Error 2
make: *** [all] Error 2
根据过去的 Stack Overflow 答案,如果未安装 m4,此安装有时会失败,但我已安装 m4 并且在我的路径中,所以这不是问题。