opa:无法编译hello chat demo(另一个错误)

时间:2011-12-10 08:30:20

标签: compiler-construction dependencies chat sample opa

我知道还有另外一篇关于此事的帖子但是,我的错误与Opa won't compile hello_web.opa不同。

尝试编译hello_chat.opa示例3. Hello, chat时,出现以下错误:

In hello_chat.opa [1:29-1:29 | global chars=29-29]
Syntax error at line 1, column 29
The error may be in the following citation, usually in the red part (starting at ?) or just before:
<<type message = {string author?,string text}

room = Network.network(message) (Network.cloud("room"))

do function start() {
 >>
Hint: expected "'" or "..." or ":" or ";" or "_" or "}" or "~" or '_' or <spacing> or <value identifier> or ['0'-'9'] or ['A'-'Z'] or ['a'-'z']
(while parsing <record type fields> starting at line 1, column 16)
Error
Syntax error

我正在运行Ubuntu 64(v11.04)并安装了所有依赖项(以下文档)。我已经从.deb包中安装了opa(opa_1.0s3.5 + build687_amd64.stable.deb)。

我也试过从源码构建它,配置步骤抱怨一些deps丢失。可能这是解决问题的关键吗?

giacomo@linuxlap:~/src/opalang$ ./configure
Checking your OS... Linux
Checking your architecture... x86_64
Checking ocamlopt... /usr/local/bin/ocamlopt
Checking ocamlbuild... /usr/local/bin/ocamlbuild
Checking ocamldir... /usr/local/lib/ocaml
Checking ocaml version... 3.12.1
Checking your ocaml setup... 3.12.1, Unix 64bit
Checking for camlp4... /usr/local/bin/camlp4o
Checking for perl 5... found
Checking for java... found
Checking for camlidl... Disabled
Checking for ocamlfind... Not found (but optional)
Checking for ssl... Not found
Checking for cryptokit... Not found
Checking for camlzip... Not found
Checking for graph... Not found
Checking for ulex... Not found

Not configured. You need the following libraries installed:
  - ocaml_ssl (might be found in package libssl-ocaml-dev)
  - cryptokit (might be found in package libcryptokit-ocaml-dev)
  - camlzip (might be found in package libzip-ocaml-dev)
  - ocamlgraph (might be found in package libocamlgraph-ocaml-dev)
  - ulex (might be found in package ocaml-ulex)

配置脚本声明丢失的软件包全部安装在我的系统中。

2 个答案:

答案 0 :(得分:2)

关于从源代码编译Opa,这是我几个月前做出的答案:

  • git clone https://github.com/MLstate/opalang.git
  • cd opalang
  • dependencies / installation_helper.sh --prefix~ / Opa
  • 在你的〜/ .profile中更改你的PATH:export PATH =〜/ Opa / bin:$ PATH
  • 重新提供您的.bashrc:source~ / .profile
  • ./ configure -prefix~ / Opa
  • make all install
  • 你的新opa编译器应该在〜/ Opa / bin中:)

答案 1 :(得分:1)

Giacomo,您所指的示例来自即将推出的 Opa S4版本的文档。它正在使用Opa的新语法,该语法将在该版本中引入。如果你想编译它,那么你需要使用S4的预览,也就是说,按照here的说明(即你需要Opa build 1024或更高版本并使用--parser js-like选项进行编译)。希望有所帮助。

P.S。您安装的版本(S3.5内置687 包含S4的预览)。