LLVM教程OCaml Compilation Assembler错误 [英] LLVM tutorial OCaml Compilation Assembler Error

查看:463
本文介绍了LLVM教程OCaml Compilation Assembler错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在通过关于OCaml的LLVM万花筒教程。在教程的第三部分中,我浏览了文件夹

I have been working through the LLVM Kaleidoscope Tutorial for OCaml. On the third part of the tutorial, I have navigated to the example code in the folder

OCaml-Kaleidoscope\Chapter3

在编译时遇到问题

ocamlbuild toy.byte

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

on cygwin. This is the code given in the tutorial to compile.

我得到的错误是

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

我使用此链接的llvm版本3.8.0和OCaml版本4.02.3。

I am using version 3.8.0 of llvm and version 4.02.3 of OCaml from this link.

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

What do I need to do to fix this?

推荐答案

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

Read the error message carefully. It says:

'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交叉汇编器。

So you do not install x86_64-w64-mingw32-as, a Cygwin cross assembler for MinGW64.

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

If you are not familiar with resolving this kind of problems by yourself, I strongly discourage using Cygwin OCaml nor MinGW OCaml, since you will face a lot of them. Using Linux (probably on a virtual environment like VirtualBox or Vmware) is the smoothest way to play with OCaml+LLVM.

这篇关于LLVM教程OCaml Compilation Assembler错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆