OpenGL +使用 Ocaml 的 GLUT

发布于 2024-11-15 13:03:00 字数 211 浏览 1 评论 0原文

我在安装 OpenGL(和 GLut)并将其与 Ocaml 一起使用时遇到问题。

我尝试过许多不同的软件包(在 Linux 和 Windows 下)但总是遇到问题 关于未找到的模块或其他。

Linux 和 Windows 哪个更容易?我到底应该做什么?哪种绑定包最好? (绑定就足够了还是我需要下载一些其他东西?)

任何人都可以以易于理解的方式逐步描述它吗?

I have a problem with installing OpenGL (and GLut) and using it with Ocaml.

I have tried many different packages (under both Linux and Windows) and always got problems
about not found modules or other.

What will be easier : Linux or Windows? What should i exactly do? Which package of bindings is the best? ( are bindings is enough or i need to download some other things?)

Could anyone describe it step by step in a way that can be easy to follow?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

听,心雨的声音 2024-11-22 13:03:00

以下是具体步骤:

sudo aptitude install liblablgl-ocaml-dev
cp /usr/share/doc/liblablgl-ocaml-dev/examples/simple.ml .
ocamlfind ocamlopt -linkpkg -package lablgl.togl simple.ml -o simple
./simple

Here are the exact steps :

sudo aptitude install liblablgl-ocaml-dev
cp /usr/share/doc/liblablgl-ocaml-dev/examples/simple.ml .
ocamlfind ocamlopt -linkpkg -package lablgl.togl simple.ml -o simple
./simple
网白 2024-11-22 13:03:00

目前我没有动力引导您完成安装过程,但这里有一些(希望有帮助的)评论:

您通常希望在 *NIX 中使用 OCaml,因为 OCaml 对它表现出非常明显的偏见。特别是,它的调试器和分析器在 Windows 中不可用。

在 Linux 中安装新库时我随机遇到的一个问题(这可能表明我正在做一些愚蠢的事情,想想看;哦,好吧)是权限错误导致模块加载错误。尝试跟踪相关库的安装位置并检查它们是否可以访问(例如,尝试以用户身份ls它们;在目录中查看它们是不够的)。

例如,我最近安装了 OCamlMPI,但收到错误,即使我提供了模块的完整路径,它也无法找到模块。
事实证明,它存储的目录 ($(ocamlc -where)/ocamlmpi) 的 modmask 为 0744(即 drwxr--r--),而它应该有0755(即drwxr-xr-x)。更改权限后,模块加载并正常工作。

事实上,这实际上也是我在安装 Python 模块时遇到的问题。也许我正在某个地方做一些愚蠢的事情。

无论如何,我希望这会有所帮助。 :)

I don't have the motivation to walk you through the installation process at the moment, but here are some (hopefully helpful) comments:

You generally want to use OCaml in *NIX because OCaml shows a very clear bias toward it. In particular, its debugger and profiler are not available in Windows.

One issue I randomly run into when installing new libraries in Linux (which may be a sign that I'm doing something dumb, come to think of it; oh, well) is permissions errors causing module loading errors. Try tracking down where the relevant libraries were installed and check that they're accessible (e.g. try lsing them as a user; seeing them in a directory is not enough).

For example, I recently installed OCamlMPI but was getting errors about it not being able to find modules even when I gave full paths to them.
It turned out that the directory it was stored in ($(ocamlc -where)/ocamlmpi) had a modmask of 0744 (i.e. drwxr--r--) when it should have had 0755 (i.e. drwxr-xr-x). After the permissions were changed, the modules loaded and worked just fine.

In fact, that's actually a problem I've run into when installing Python modules, too. Maybe I am doing something dumb somewhere.

Anyway, I hope that helps. :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文