我一直在学习OCaml的LLVM万花筒教程。在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。
我需要做些什么来解决这个问题?
发布于 2016-05-05 09:55:36
请仔细阅读错误消息。上面写着:
'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最流畅的方式。
https://stackoverflow.com/questions/37038709
复制相似问题