首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >LLVM教程OCaml编译汇编程序错误

LLVM教程OCaml编译汇编程序错误
EN

Stack Overflow用户
提问于 2016-05-05 05:52:09
回答 1查看 247关注 0票数 0

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

代码语言:javascript
复制
OCaml-Kaleidoscope\Chapter3

我在编译时遇到一个问题

代码语言:javascript
复制
ocamlbuild toy.byte

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

我得到的错误是

代码语言:javascript
复制
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。

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

EN

回答 1

Stack Overflow用户

发布于 2016-05-05 09:55:36

请仔细阅读错误消息。上面写着:

代码语言:javascript
复制
'x86_64-w64-mingw32-as' is not recognized as an internal or external command, operable program or batch file.

因此,您没有安装MinGW64的Cygwin交叉汇编程序x86_64-w64-mingw32-as

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

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/37038709

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档