Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] How to install a package
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Alain Frisch <frisch@c...>
Subject: Re: [Caml-list] How to install a package
On 8 Aug 2001, Johann Spies wrote:

> I have followed the instructions for installing libpq_ocaml.

(libpq_ocaml is no longer maintained; you may want to install Postgres
instead (safer interface, more examples); I will give instructions for it)

> But how can I use libpq in the toplevel?

As the package contains C objects, you have to build a custom toplevel:

ocamlfind ocamlmktop -o postgres_top -linkpkg -package postgres

You also have to pass to this toplevel the directory where it can
find the .cmi files for the package (is there a reason
for ocamlmktop not putting the -I options in the custom toplevel ?):

./postgres_top -I `ocamlfind query postgres`

        Objective Caml version 3.01

# let c = new Postgres.connection "host=clipper";;
val c : Postgres.connection = <obj>
# c # user;;
- : string = "frisch"


Hope this helps.

--
 Alain

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr