ocaml toplevel throws error unbounded module

房东的猫 提交于 2019-12-11 14:37:52

问题


I installed OCAML and OPAM, then I installed libraries such as ocaml-http using OPAM. When I tried to open module Http_types, ocaml toplevel is throwing error unbounded module.

I tried to set CAML_LD_LIBRARY_PATH in /home/ubuntu/.opam/opam-init/variables.sh

old one generated during opam init:

CAML_LD_LIBRARY_PATH=/home/ubuntu/.opam/4.01.0/lib/stublibs; export CAML_LD_LIBRARY_PATH; PERL5LIB=/home/ubuntu/.opam/4.01.0/lib/perl5:$PERL5LIB; export PERL5LIB; OCAML_TOPLEVEL_PATH=/home/ubuntu/.opam/4.01.0/lib/toplevel; export OCAML_TOPLEVEL_PATH; MANPATH=$MANPATH:/home/ubuntu/.opam/4.01.0/man; export MANPATH; PATH=/home/ubuntu/.opam/4.01.0/bin:$PATH; export PATH;

I added CAML_LD_LIBRARY_PATH=/home/ubuntu/.opam/4.01.0/lib/stublibs:/home/ubuntu/.opam/4.01.0/lib; export CAML_LD_LIBRARY_PATH;

/home/ubuntu/.opam/4.01.0/lib is where all the new non-standard libraries are installed. But when i do opam init again newly added line will disappear.


回答1:


You need to load this library with a #require directive, something like this should work:

#use "topfind";;
#require "ocaml-http";;

Do not forget to actually type this # symbol.



来源:https://stackoverflow.com/questions/26689385/ocaml-toplevel-throws-error-unbounded-module

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!