title: unbound value with the out of Format.fprintf
body: <p>i'm actually on writing a personnal Frama-C plugin wich contains those four files :</p>
  
  <p><strong>analyseTU_core.ml</strong></p>
  
  <pre><code>module Options = AnalyseTU_options
  
  open Cil_types
  
  let rec member x list1 = match list1 with 
      []-&gt;false
      |hd :: tl -&gt; if hd = x then true else member x tl
  
  let rec sandr list2 result= match list2 with
      []-&gt; Format.fprintf out "job termine"
      |hd :: tl -&gt; if member hd result = false then begin result::hd ; Format.fprintf out hd; sandr tl result end
          else sandr tl result
  
  class print_analyse out = object 
      inherit Visitor.frama_c_inplace
  
  method vstmt s=
      let listing =[] in
      let impacted = !Db.Impact.compute_pragmas in
      let impacted2= impacted.Stmt.loc in
      sandr impacted2 listing;
      Cil.DoChildren
     end
  </code></pre>
  
  <p>and :</p>
  
  <p><strong>analyseTU_register.ml</strong></p>
  
  <pre><code>open AnalyseTU_options
  open AnalyseTU_core
  
  let run () =
      if Enabled.get () then
      let filename=OutputFile.get () in
      let chan = open_out filename in
      let fmt = Format.formatter_of_out_channel chan in
      Visitor.visitFramacFileSameGlobals (new print_analyse fmt) (Ast.get ());
      close_out chan
  
  let () = Db.Main.extend run
  </code></pre>
  
  <p>and :</p>
  
  <p><strong>analyseTU_options.ml</strong></p>
  
  <pre><code>module Self = Plugin.register 
  (struct
    let name = "analyse TU"
    let shortname = "TU"
    let help = "impacted statements computation from a source code modification and display consequently unit tests to be run in an output file"
  end)
  
  module Enabled = Self.False 
  (struct
    let optilon_name = "-TU"
    let help = "when on (off by default), give the unit tests to be run"
  end)
  
  module OutputFile = Self.String 
  (struct
    let option_name = "-TU-output"
    let default = "TUresults.txt"
    let arg_name = "output-file"
    let help = "name of the output file"
  end)
  </code></pre>
  
  <p>and finally the makefile :</p>
  
  <pre><code>FRAMAC_SHARE := $(shell frama-c -print-path)
  FRAMAC_LIBDIR := $(shell frama-c -print-libpath)
  PLUGIN_NAME = analyseTU
  PLUGIN_CMO = analyseTU_options analyseTU_core analyseTU_register
  include $(FRAMAC_SHARE)/Makefile.dynamic
  </code></pre>
  
  <p>so, when i compile it with the make command, i'm actually getting :</p>
  
  <pre><code>FILE "analyseTU_core.ml", line 9 :
  Error: unbound value out
  make : *** [analyseTU_core.cmo] erreur 2
  </code></pre>
  
  <p>i was so thinking that it was due to the fact 'out' is unknown to the compiler, and i remplaced 'out' by 'chan'. I was getting by the way the same error.</p>
  
  <p>The fact that 'out' is not defined in the code of the developer's guide's tutorial makes finally me think this error is not what i think it is...</p>
  
  <p>Have you ever encountered it? if yes, how did you deal with it?</p>