我尝试在其中一个文件中打开Yojson.Basic.Util
并不断收到错误nbound module
。我尝试了几种不同的东西,似乎无法弄清楚出了什么问题
我在.ocamlinit
:
#require "yojson";;
#require "ANSITerminal";;
这是我的makefile
:
test:
ocamlbuild -pkg yojson, oUnit test.byte && ./test.byte
play:
ocamlbuild -pkgs oUnit,yojson,str,ANSITerminal main.byte && ./main.byte
check:
bash checkenv.sh
clean:
ocamlbuild -clean
键入make
会产生此错误:
ocamlbuild -pkg yojson, oUnit test.byte && ./test.byte
ocamlfind: Package `yojson,' not found
Cannot run Ocamlfind.
make: *** [test] Error 2
将makefile
更改为:
test:
ocamlbuild -use-ocamlfind -pkg yojson, oUnit test.byte && ./test.byte
play:
ocamlbuild -pkgs oUnit,yojson,str,ANSITerminal main.byte && ./main.byte
check:
bash checkenv.sh
clean:
ocamlbuild -clean
我输入make
,它给了我这个错误:
ocamlbuild -use-ocamlfind -pkg yojson, oUnit test.byte && ./test.byte
Solver failed:
Ocamlbuild knows of no rules that apply to a target named oUnit. This can happen if you ask Ocamlbuild to build a target with the wrong extension (e.g. .opt instead of .native) or if the source files live in directories that have not been specified as include directories.
Compilation unsuccessful after building 0 targets (0 cached) in 00:00:00.
make: *** [test] Error 6