Unbound value format_float http://www.ocaml-tutorial.org/if_statements,_loops_and_recursion

The string_of_float example function does not compile (apparently Pervasives has been changed since the tutorial was written.):

ocamlc -I ../cil-1.3.7/obj/x86_LINUX error.ml
File "error.ml", line 10, characters 10-22:
Unbound value format_float

Solution

Define the missing functions yourself. E.g.:
  let format_float text data = Printf.sprintf text data in
  let string_length s = String.length s in

Solutions suggested by Kiran.
Other Ocaml CIL solutions.


Created 30 Jun 2010 by W.Langdon (last update 6 June 2013)