Ocaml 无法使用带有jbuilder的lablgtk2生成程序
在使用Ocaml 无法使用带有jbuilder的lablgtk2生成程序,ocaml,lablgtk,ocaml-dune,Ocaml,Lablgtk,Ocaml Dune,在使用lablgtk2编译时,我想使用jbuilder,但在获取这些错误消息时遇到问题: File "_none_", line 1: Error: No implementations provided for the following modules: Thread referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx Mutex referenced fr
lablgtk2
编译时,我想使用jbuilder
,但在获取这些错误消息时遇到问题:
File "_none_", line 1:
Error: No implementations provided for the following modules:
Thread referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx
Mutex referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx
Condition referenced from /Users/hadilsabbagh/.opam/4.05.0/lib/lablgtk2/gtkThread.cmx
这是我的jbuild
:
(jbuild_version 1)
(executable
((name simple)
(libraries (lablgtk2))
))
最有可能的是,您的
jbuild
缺少对core
的依赖项(由于gtkThread.cmx
),它应该与以下jbuild文件一起工作:
(jbuild_version 1)
(executable
((name simple)
(libraries (core lablgtk2))
))
这是由于。jbuilder/dune自动添加mt
谓词,这意味着如果您的库提供了一个线程选项,那么将使用它,并且您需要添加线程作为依赖项:
(jbuild_version 1)
(executable
((name simple)
(libraries (threads lablgtk2))
))
注意,库的顺序在ocaml中很重要,线程
需要在lablgtk2
之前