drkcore

2009/07/11 21:07:24

OCamlのUnknow directive

ocamlnetのhttp clientのサンプルを実行しようとしたら

#require "netclient";;
open Http_client.Convenience;;
let get_and_print url =
  let s = http_get url in
  print_string s;
  flush stdout
;;

このrequireでエラー

# #require "netclient";;
Unknown directive `require'.

解決方法

sudo port install caml-findlib

で、.ocamlinitに

#use "topfind"

と書いておく。

モジュールっていうかライブラリ周りの流儀がまだよく分かってない。

Comments