1

我想jbuilder在编译时使用,lablgtk2但在收到这些错误消息时遇到问题:

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))
  ))
4

2 回答 2

1

这是由于这个问题。jbuilder/dunemt自动添加谓词,这意味着如果您的库提供线程选项,它将被使用,并且您需要添加threads为依赖项:

(jbuild_version 1)

(executable
  ((name simple)
  (libraries (threads lablgtk2))
  ))

请注意,库的顺序在 ocaml 中很重要,threads需要在lablgtk2.

于 2018-04-16T07:37:09.203 回答
-2

最有可能的是,您缺少对(due to )jbuild的依赖,它应该与以下 jbuild 文件一起使用:coregtkThread.cmx

(jbuild_version 1)

(executable
  ((name simple)
  (libraries (core lablgtk2))
  ))
于 2017-11-10T20:05:53.397 回答