Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Error compiling classes with ocamlcp?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Grégoire Sutre <sutre@l...>
Subject: [Caml-list] Error compiling classes with ocamlcp?

I got an error trying to compile an OCaml file with profiling support.  I 
believe the problem arises from the use of objects in my code.

On the following simple OCaml source:

class my_class =
  method do_nothing = ()

The command "ocamlcp -c" gives:

File "/home/sutre/tmp/camlppc6dad0", line 1, characters 29-33:
Syntax error

And the generated camlppc6dad0 file is as follows:

let __ocaml_prof_cnt_ocamlcp-bug_ = Array.create 0000001 0;; 
Profiling.counters := ("ocamlcp-bug", ("fm", __ocaml_prof_cnt_ocamlcp-bug_)) 
:: !Profiling.counters;; class my_class =
  (__ocaml_prof_cnt_ocamlcp-bug_.(0) <- Pervasives.succ 
__ocaml_prof_cnt_ocamlcp-bug_.(0); method do_nothing = ())

This generated file indeed doesn't compile with ocamlc.  I am using the OCaml 
distribution version 3.06.  Doesn't ocamlcp support objects?

Thanks for your help,

Gregoire Sutre.
To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: