Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] problem with Printf.printf when linking in bytecode interpreter to C app
@ 2004-01-26  3:42 Kip Macy
  2004-01-26  4:56 ` SooHyoung Oh
  0 siblings, 1 reply; 3+ messages in thread
From: Kip Macy @ 2004-01-26  3:42 UTC (permalink / raw)
  To: caml-list

I've linked the ocaml runtime into my application:
this is my ocaml.ml:
let _ = Printf.printf "ocaml inited\n"

let foo () = Printf.printf "this works\n"


let rec fib n = if n < 2 then 1 else fib(n-1) + fib(n-2)

let _ = Callback.register "foo" foo

let _ = Callback.register "fib" fib


This is the relevant C code:
    printf("calling caml_startup\n");
    caml_startup(argv);
    callback(*caml_named_value("foo"), Val_unit);
    result = Int_val(callback(*caml_named_value("fib"), Val_int(6)));
    printf("the result of fib is %d\n", result);


The only output I get is:
calling caml_startup
the result of fib is 13

Why don't the Printf.printf statements output anything?


Thanks.

				-Kip

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


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

end of thread, other threads:[~2004-01-26  5:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-01-26  3:42 [Caml-list] problem with Printf.printf when linking in bytecode interpreter to C app Kip Macy
2004-01-26  4:56 ` SooHyoung Oh
2004-01-26  5:52   ` Kip Macy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox