我正在使用 Jane Street
的 async_core
,将 package(async_core)
添加到 _tags
中。
当我使用 ocamlbuild -use-ocamlfind -I src test/test_airport.native
时,它给了我以下错误:
camlfind ocamlopt -linkpkg -package async_core -package unix -package netclient -package mongo -package xml-light src/airport.cmx test/test_airport.cmx -o test/test_airport.native ocamlfind: Error from package `threads': Missing -thread or -vmthread switch
我搜索了一下,这是我得到的链接:http://caml.inria.fr/pub/docs/manual-ocaml-4.00/manual039.html
它说:
使用系统线程的程序必须链接如下:
ocamlc -thread other options unix.cma threads.cma other files
所以我将我的ocamlbuild命令更改为:
ocamlbuild -use-ocamlfind -cflag -thread -I src test/test_airport.native
但错误仍然存在。实际生成的ocamlbuild命令也没有
-thread
。
我该如何处理?