Version française
Home     About     Download     Resources     Contact us    
Browse thread
Producing a C wrapper with ocamlbuild or OMake
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Nicolas Pouillard <nicolas.pouillard@g...>
Subject: Re: [Caml-list] Producing a C wrapper with ocamlbuild or OMake
On 3/28/07, Joel Reymont <joelr1@gmail.com> wrote:
> One last question... Two, actually.
>
> How would I add another C file to the pipeline to produce the final
> executable?

Add it like a link flag.

flag ["ocaml"; "link"; "output_obj"(* I think that's where you want it
*)] (A"your_file.o");

Then add it to dependencies to force it's creation.

dep ["ocaml"; "link"; "output_obj"(* I think that's where you want it
*)] ["your_file.o"];

> Then, I tried using the library I built but I get an error. I have no
> iea what's going on, does anyone? I'm on Mac OSX if it matters.
>
> gcc foo.c -L_build -lmorpher -o foo
> /usr/bin/ld: Undefined symbols:
> _caml_atom_table
> _caml_code_area_end
> _caml_code_area_start
> _caml_static_data_end
> _caml_static_data_start
> collect2: ld returned 1 exit status
>
> nm _build/libmorpher.a |grep caml_atom_table
> 00000400 C _caml_atom_table
>           U _caml_atom_table
>

No idea.

-- 
Nicolas Pouillard