【问题标题】:LLVM tutorial OCaml Compilation Assembler ErrorLLVM教程OCaml Compilation Assembler Error
【发布时间】:2016-05-04 21:52:09
【问题描述】:

我一直在学习 OCaml 的 LLVM Kaleidoscope 教程。在third part of the tutorial 上,我已经导航到文件夹中的示例代码

OCaml-Kaleidoscope\Chapter3

编译时遇到问题

ocamlbuild toy.byte

在 cygwin 上。这是教程中给出的编译代码。

我得到的错误是

mkdir 'C:\Users\setup\Compiler\llvm\examples\OCaml-Kaleidoscope\Chapter3\_build'
''ocamlopt.opt unix.cmxa -I 'C:\OCaml\lib\ocamlbuild' 'C:\OCaml\lib\ocamlbuild/ocamlbuildlib.cmxa' myocamlbuild.ml 'C:\OCaml\lib\ocamlbuild/ocamlbuild.cmx' -o myocamlbuild.exe
'x86_64-w64-mingw32-as' is not recognized as an internal or external command,
operable program or batch file.
File "myocamlbuild.ml", line 1:
Error: Assembler error, input left in file C:\cygwin64\tmp\camlasmc2c035.s
Exit code 2 while executing this command:
''ocamlopt.opt unix.cmxa -I 'C:\OCaml\lib\ocamlbuild' 'C:\OCaml\lib\ocamlbuild/ocamlbuildlib.cmxa' myocamlbuild.ml 'C:\OCaml\lib\ocamlbuild/ocamlbuild.cmx' -o myocamlbuild.exe

我正在使用来自this link 的 llvm 3.8.0 版和 OCaml 4.02.3 版。

我需要做什么来解决这个问题?

【问题讨论】:

  • 你写了“这个链接”,但是没有链接。您使用了哪个 OCaml 安装程序?

标签: cygwin ocaml llvm ocamlbuild


【解决方案1】:

仔细阅读错误信息。它说:

'x86_64-w64-mingw32-as' is not recognized as an internal or external command, operable program or batch file.

所以你不要安装 x86_64-w64-mingw32-as,这是一个用于 MinGW64 的 Cygwin 交叉汇编程序。

如果你不熟悉自己解决这类问题,我强烈反对使用 Cygwin OCaml 或 MinGW OCaml,因为你会遇到很多。使用 Linux(可能在 VirtualBox 或 Vmware 等虚拟环境上)是玩 OCaml+LLVM 最流畅的方式。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2014-07-17
    • 2012-03-03
    • 1970-01-01
    • 1970-01-01
    • 2018-06-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多