未绑定的模块Yojson.Basic.Util

时间:2016-12-04 00:25:43

标签: makefile build functional-programming ocaml

我尝试在其中一个文件中打开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

0 个答案:

没有答案
相关问题