modcaml
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Modcaml] Re: mod caml and source splitting


From: Richard Jones
Subject: [Modcaml] Re: mod caml and source splitting
Date: Sat, 5 Nov 2005 11:58:12 +0000
User-agent: Mutt/1.3.28i

> Hello,
> 
> I cant manage to get ocaml modules to work with mod_caml.
> I want to split my source files into common parts, and parts that are
> specific to each page.
> 
> Here is my source :
> - file common.mli :
> val a:string
> - file common.ml :
> let a="AAA";;
> - file main.ml :
> open Common
> let test=Common.a;;
> open Apache
> open Registry
> open Cgi
> let run r=
>       let q=new cgi r in
>       q#template ("<html><body>"^test^"</body></html>")
> let ()=register_script run
> 
> I get an apache error "500 Internal Server Error", and
> tail /var/log/apache/error.log shows an OCaml error : "Reference to
> undefined globla Common"
> 
> What am I doing wrong ? May I try special compilation options ?

Hi,

What you need to do is to compile common.{mli,ml} into a .cmo file (or
into a .cma library if you prefer).  Then load this in the
configuration file:

  CamlLoad path/to/common.cmo     # (or .cma)

Put this CamlLoad after any others you have (eg. for registry.cmo).

Rich.

-- 
Richard Jones, CTO Merjis Ltd.
Merjis - web marketing and technology - http://merjis.com
Team Notepad - intranets and extranets for business - http://team-notepad.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]