问题标签 [ocamlfind]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
331 浏览

cygwin - 在cygwin4下安装ocamlfind有困难

我已经在 cygwin64(Windows 10 计算机)下安装了 ocaml。Ocaml,ocamlc 似乎运行良好,但我需要包。所以我尝试了 opam,它抱怨 ocamlfind 丢失了。我尝试以两种方式安装 ocamlfind - 使用 opam 和从 gitlab.camlcity.org 上的 findlib 存储库 - 在这两种情况下,它都未能找到dllunix.so。我注意到环境变量 OCAMLLIB 是 C:\Ocaml(即在 cygwin 目录树之外),但在 /usr/lib/ocaml/stublibs 中有这样一个文件。修改 OCAMLLIB 指向那里后,我收到以下错误。

无法加载所需的共享库 dllunix。原因:/usr/lib/ocaml/stublibs/dllunix.so: flexdll error: cannot relocate RELOC_REL32, target is too far: 0xfffffffc02c37112 0x2c37112.

我在另一个图书馆也有类似的消息:

错误:动态加载库出错:/usr/lib/ocaml/stublibs/dllcamlstr.so:flexdll 错误:无法重新定位 RELOC_REL32,目标太远:0xfffffffc02b6a92a 0x2b6a92a

0 投票
1 回答
957 浏览

ocaml - ocamlfind complains no implementation provided for modules installed through opam

I was messing around with the OCaml FFI to try to figure out how it goes about inferring the width of a C enum (which I think is implementation-defined for C) and am trying to insert a type of the wrong width to see what blows up at runtime. That's the motivation, but the actual issue I ran into is much more mundane.

I have a simple OCaml file that uses the C FFI to call a trivial function in example.c that converts an enum to an int.

I configured opam and installed Ctypes and Ctypes.Foreign

The two usual incantations I use for compiling a simple .ml script have both failed me and I'm out of ideas. ocamlfind and corebuild (which I think is a wrapper on top of ocamlbuild)

ocamlfind can't seem to find ctypes and foreign. However, it doesn't complain that about not being able to locate the packages so I'm guessing ctypes and ctypes.foreign are the correct names for these packages in the weird findlib namespace.

Why can't ocamlfind locate these modules? I have no problem loading them into the toplevel.

0 投票
0 回答
388 浏览

ocaml - macOS Sierra 上的 Opam 失败

我遇到的问题与这个问题非常相似。

我在 macOS Sierra 上有一台 MacBook Pro。我已经通过 brew 安装了 ocaml 和 opam。( brew install ocaml, brew install opam) 这已安装ocaml 4.03.0,并且它似乎可以自己正常工作。

我尝试安装oasis( opam install oasis),但由于安装失败,安装失败ocamlfind

我认为它可能与 相关ocaml 4.03.0,所以我尝试切换到ocaml 4.02.1. ( opam switch 4.02.1) 这也失败了:

我尝试重新安装 XCode,我尝试通过 homebrew 使用--build-from-source选项(包括rm -rf ~/.opam)重新安装 ocaml 和 opam,并且错误仍然存​​在。

有没有其他人遇到过这样的问题?

0 投票
1 回答
416 浏览

makefile - Ocamlbuild 找不到 Ocamlbuild_js_of_ocaml cmx 文件

我正在开始一个 Web 开发项目,并希望使用 Js_of_ocaml。但是,当尝试使用 OCamlbuild 作为我的构建工具时,我遇到了以下错误:

警告 58:在模块 Ocamlbuild_js_of_ocaml 的路径中找不到 cmx 文件,并且其接口未使用 -opaque 编译

我的 Makefile 如下:

我的 myocamlplugin.ml 文件包含文档中的文本:

最后,我正在尝试编译一个最小的测试文件:

如果有帮助,我在Arch Linux上运行OCaml 4.03.0ocamlbuild 0.9.3
提前致谢!

0 投票
1 回答
3043 浏览

gtk - Ocaml 错误:编译时未绑定模块

我正在学习 Ocaml,目前我正在为游戏构建图形界面。我使用了 Graphics 和 camlimages,但现在我想添加一些按钮。所以我搜索了 Gtk2,但现在编译时遇到了问题。这是我的代码的一部分:

我用了

之前为了编译结合 _tags 文件,但是为了包含 gtk 模块,我试过了

这似乎在示例示例中有效,但是当我将它与我的项目结合使用时,我得到“错误:未绑定模块 Gamebase”。我试过了

但似乎不起作用。非常感谢任何提示和客气话。

0 投票
2 回答
178 浏览

ocaml - sexplib 编译错误

我需要在我的程序中使用 Sexplib。我试过了

我得到了错误。但是如果我先加载 ppx_sexp_conv 包,我可以在顶层使用 Sexplib:

所以我也试过这个:

我不知道这意味着什么以及我现在需要做什么......有人可以帮忙吗?

0 投票
1 回答
223 浏览

ocaml - 将 ocamlmktop 与 ocamlbuild 一起使用

我有一个使用 ocamlbuild 成功构建的项目。但是,我还想要一种简单的方法来通过顶层与来自不同模块的项目的各个功能进行交互,但是我使用 ocamlmktop 的尝试并没有达到我想要的效果。我发现除非我手动将 .cmi 文件放在活动目录中,否则我会收到“未绑定模块”错误。我目前用来构建的命令是:

有没有更好、更简单的方法来让顶层在这个项目结构中工作,而无需将 cmi 文件移出 _build 目录?

编辑:我发现如果我将顶层运行为

但这似乎仍然很老套。有没有办法烘焙搜索路径或 cmi 文件?

编辑 2:考虑到接口文件的限制,我认为解决我的问题的方法实际上可能根本不编译自定义顶层。相反,我在我的 .ocamlinit 中添加了加载指令以使用这些模块。如果有人有更好的想法来解决这个问题,我将不胜感激。

0 投票
1 回答
866 浏览

ocaml - ocamlfind:在 ubuntu 17.04 上找不到包“lablgtk2.gnomecanvas”

我正在尝试在 Ubuntu 17.04 (Zesty) 上从存储库 (6aa64) 安装 Frama-C gui Phosphorus。Frama-C opam 工作正常,但据我所知它缺少 GUI + 我可能想稍后修补 frama-C,所以我希望能够自己编译它。

第一步:

生成输出:

...一旦我运行 make 最终结果是:

我安装了 libgnomecanvas2(*)。这个问题已经在这里提到了没有解决方案: https ://lists.gforge.inria.fr/pipermail/frama-c-discuss/2017-January/005200.html

我对 ocaml 了解不多,但似乎 gnomecanvas 应该在/usr/lib/ocaml/lablgtk2/. 我上传了这个文件夹的列表,如果它可以在这里提供帮助https://transfer.sh/4lQol/listing(对于 SO 来说太大了)

最好的问候马特

0 投票
0 回答
75 浏览

makefile - 将 core.std 导入 frama-c 的插件

我还有其他问题,我尝试将 Makefile 更改为包含 Core.Std,我想将它用于模块列表。

这是我的 MakeFile。

当我使用“make”时,这是错误:

在 Real Open World Ocaml 中,它使用: ocamlfind ocamlc -linkpkg -thread -package core

如何在frama-c中模拟它?

0 投票
0 回答
385 浏览

ocaml - ocamlfind 查询 ... 以错误代码 2 终止

我正在尝试从此 GitHub 安装 ocaml 包:

在 Linux Ubuntu 14.04 上。我已经安装了 ocaml 和相关工具(我认为):

但是当我尝试运行 ocaml 设置时,我收到错误消息:

非常感谢任何帮助,谢谢。

编辑:

感谢 Mars,opam install core(和其他软件包)解决了这个问题。但是,我现在面临这个:

有什么建议么?谢谢!