From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id EAA00737; Mon, 26 Jan 2004 04:42:06 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id EAA00551 for ; Mon, 26 Jan 2004 04:42:04 +0100 (MET) Received: from demos.bsdclusters.com (demos.bsdclusters.com [69.55.225.36]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id i0Q3g3P24198 for ; Mon, 26 Jan 2004 04:42:03 +0100 (MET) Received: from demos.bsdclusters.com (demos [69.55.225.36]) by demos.bsdclusters.com (8.12.8p1/8.12.8) with ESMTP id i0Q3g1oO083407 for ; Sun, 25 Jan 2004 19:42:01 -0800 (PST) (envelope-from kmacy@fsmware.com) Received: from localhost (kmacy@localhost) by demos.bsdclusters.com (8.12.8p1/8.12.8/Submit) with ESMTP id i0Q3g1VX083402 for ; Sun, 25 Jan 2004 19:42:01 -0800 (PST) X-Authentication-Warning: demos.bsdclusters.com: kmacy owned process doing -bs Date: Sun, 25 Jan 2004 19:42:01 -0800 (PST) From: Kip Macy X-X-Sender: kmacy@demos.bsdclusters.com To: caml-list@inria.fr Subject: [Caml-list] problem with Printf.printf when linking in bytecode interpreter to C app Message-ID: <20040125193722.J53910@demos.bsdclusters.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Loop: caml-list@inria.fr X-Spam: no; 0.00; kip:99 printf:01 printf:01 runtime:01 foo:01 callback:01 foo:01 callback:01 argv:01 val:01 val:01 linked:01 ocaml:01 ocaml:01 caml:01 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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