caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Problem using camlp4o on windows.
@ 2009-01-27 16:11 Ed Keith
  2009-01-27 16:37 ` Re : [Caml-list] " Matthieu Wipliez
  0 siblings, 1 reply; 3+ messages in thread
From: Ed Keith @ 2009-01-27 16:11 UTC (permalink / raw)
  To: caml-list

I am trying to learn to use camlp4. I started by working my way through the tutorial at http://www.ocaml-tutorial.org/camlp4_3.10/foreach_tutorial

I created the file :

   open Camlp4.PreCast
   open Syntax

   EXTEND Gram
     expr: LEVEL "top"
       [ [ "for"; v = a_LIDENT; "in"; m = a_UIDENT; e = expr; "do";
           seq = sequence; "done" ->
             <:expr< $uid:m$.iter (fun $lid:v$ -> $seq$) $e$ >>
         ] ]
     ;
   END

and complied it with the command line:

    C:\Documents and Settings\Ed Keith\My Documents\playpen\ocaml>ocamlc -I +camlp4 camlp4lib.cma -pp camlp4orf -c pa_foreach.ml

So far so good. Then I ran into the following problem when I tried to use it. Here is the result: 

  C:\Documents and Settings\Ed Keith\My Documents\playpen\ocaml>ocaml
        Objective Caml version 3.11.0

  # #load "camlp4o.cma";;
  Characters -1--1:
    #load "camlp4o.cma";;

  Error: Reference to undefined global `Dynlink'
  # exit 0;;

I have searched the web and I am beginning to suspect that I can not use camlp4 on a windows system, is this the case? 

If so I can move to a Linux box, but if I can not use it to generate portable code it will not be very useful for me to learn it.

    -EdK


Ed Keith
e_d_k@yahoo.com

Blog: edkeith.blogspot.com



      


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re : [Caml-list] Problem using camlp4o on windows.
  2009-01-27 16:11 Problem using camlp4o on windows Ed Keith
@ 2009-01-27 16:37 ` Matthieu Wipliez
  0 siblings, 0 replies; 3+ messages in thread
From: Matthieu Wipliez @ 2009-01-27 16:37 UTC (permalink / raw)
  To: caml-list

>   C:\Documents and Settings\Ed Keith\My Documents\playpen\ocaml>ocaml

>         Objective Caml version 3.11.0
> 
>   # #load "camlp4o.cma";;
>   Characters -1--1:
>     #load "camlp4o.cma";;
> 
>   Error: Reference to undefined global `Dynlink'
>   # exit 0;;
> 
> I have searched the web and I am beginning to suspect that I can not use camlp4 
> on a windows system, is this the case?

I don't think so :-)
Since version 3.11 if you want to use Camlp4 you also need to explicitly load Dynlink, in order to avoid multiple linking problem (or something like that).
This is listed in the Changes:

  Camlp4:
  * programs linked with camlp4lib.cma now also need dynlink.cma.

Using #load "dynlink.cma";; before loading camlp4 will do the trick (I just checked).

Cheers,
Matthieu






^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Re : [Caml-list] Problem using camlp4o on windows.
@ 2009-01-27 16:58 Ed Keith
  0 siblings, 0 replies; 3+ messages in thread
From: Ed Keith @ 2009-01-27 16:58 UTC (permalink / raw)
  To: caml-list, Matthieu Wipliez

That solved the problem.

Thank you very much.

    -EdK

Ed Keith
e_d_k@yahoo.com

Blog: edkeith.blogspot.com

--- On Tue, 1/27/09, Matthieu Wipliez <mwipliez@yahoo.fr> wrote:

From: Matthieu Wipliez <mwipliez@yahoo.fr>
Subject: Re : [Caml-list] Problem using camlp4o on windows.
To: caml-list@inria.fr
Date: Tuesday, January 27, 2009, 11:37 AM

>   C:\Documents and Settings\Ed Keith\My Documents\playpen\ocaml>ocaml

>         Objective Caml version 3.11.0
> 
>   # #load "camlp4o.cma";;
>   Characters -1--1:
>     #load "camlp4o.cma";;
> 
>   Error: Reference to undefined global `Dynlink'
>   # exit 0;;
> 
> I have searched the web and I am beginning to suspect that I can not use camlp4 
> on a windows system, is this the case?

I don't think so :-)
Since version 3.11 if you want to use Camlp4 you also need to explicitly load Dynlink, in order to avoid multiple linking problem (or something like that).
This is listed in the Changes:

  Camlp4:
  * programs linked with camlp4lib.cma now also need dynlink.cma.

Using #load "dynlink.cma";; before loading camlp4 will do the trick (I just checked).

Cheers,
Matthieu





_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs






^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-01-27 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-27 16:11 Problem using camlp4o on windows Ed Keith
2009-01-27 16:37 ` Re : [Caml-list] " Matthieu Wipliez
2009-01-27 16:58 Ed Keith

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).