-2

私は Ocsigen の例 ( http://ocsigen.org/tuto/manual/macaque ) に取り組んでいます。

プログラムをコンパイルしようとすると、次のようなエラーが発生します。

File "testDB.ml", line 15, characters 14-81 (end at line 18, character 4):
While finding quotation "table" in a position of "expr":
Available quotation expanders are:
svglist (in a position of expr)
svg (in a position of expr)
html5list (in a position of expr)
html5 (in a position of expr)
xhtmllist (in a position of expr)
xhtml (in a position of expr)

Camlp4: Uncaught exception: Not_found

私のコードは次のとおりです。

 module Lwt_thread = struct
 include Lwt
 include Lwt_chan
 end
 module Lwt_PGOCaml = PGOCaml_generic.Make(Lwt_thread)
 module Lwt_Query = Query.Make_with_Db(Lwt_thread)(Lwt_PGOCaml)

 let get_db : unit -> unit Lwt_PGOCaml.t Lwt.t =
 let db_handler = ref None in
 fun () ->
   match !db_handler with
      | Some h -> Lwt.return h
      | None -> Lwt_PGOCaml.connect ~database:"testbase" ()

let table = <:table< users (
  login text NOT NULL,
  password text NOT NULL
) >>
..........

eliom-destillery を使用して基本ファイルを生成しました。「make」を使用してプログラムをコンパイルしました。

さまざまなことを試し、Google検索を実行しましたが、問題がわかりません。どんなヒントでも大歓迎です。

4

1 に答える 1

0

一般的に言えば、エラー メッセージは、CamlP4 が使用した引用符 here を認識していないことを示しておりtable、これはコードで として使用されています<:table< ... >>pa_xxx.cmo引用符は、CamlP4 拡張機能(またはpa_xxx.cma) モジュールによって追加できます。引用符の名前をタイプミスしない限り、それを CamlP4 に提供する拡張機能をロードできませんでした。

http://ocsigen.org/tuto/manual/macaqueによると、Macaque (またはその基礎となるライブラリ? 私は一度も使用したことがないのでわかりません) は引用を提供しますtable。そのため、CamlP4 に対応する拡張機能をロードするように指示する必要があります。バニラの eliom-destillery は、基本的な eliom プログラミングには最低限のものであり、Macaque の拡張機能には対応していないと思います。

実際、ドキュメントhttp://ocsigen.org/tuto/manual/macaqueはそれを指摘しています:

Makefile で macaque を参照する必要があります。

SERVER_PACKAGE := macaque.syntax

これは、 に必要な CamlP4 構文拡張名である必要がありtableます。

于 2014-03-11T01:42:12.233 に答える