caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* how to use c wrapper files in libraries
@ 2009-07-20 14:28 Aaron Bohannon
  2009-07-20 14:58 ` [Caml-list] " RABIH.ELCHAAR
  2009-07-20 23:40 ` Erik de Castro Lopo
  0 siblings, 2 replies; 6+ messages in thread
From: Aaron Bohannon @ 2009-07-20 14:28 UTC (permalink / raw)
  To: caml-list

Hello,

I am trying to use the wrapper for libsndfile contributed by Erik de
Castro Lopo (http://caml.inria.fr/cgi-bin/hump.en.cgi?contrib=556).
The wrapper code compiles just fine.  And the tests that use the OCaml
library it builds work just fine.  However, I am having a frustrating
compile-time error when I try to compile my program in a different
directory.

The wrapper code is being packaged into an OCaml library using the
following command:

ocamlc -a -o sndfile.cma -custom sndfile_stub.o sndfile.cmo \
  -ccopt -L/usr/local/lib -cclib -lsndfile

Within the same directory, the test program can be successfully compiled with:

ocamlc -o test_sndfile sndfile.cma test_sndfile.ml

Within a different directory, I used:

ocamlc -o mytest -I /path/to/libsndfile-ocaml/files/   sndfile.cma   mytest.ml

And I get:

powerpc-apple-darwin8-gcc-4.0.1: sndfile_stub.o: No such file or directory
Error while building custom runtime system

I have tried setting every path-related option I could find, and
nothing helped.  I tried reading everything I could find about
compiling and using c wrappers for OCaml, but there is a severe lack
of documentation on the topic.  In particular, I could find no example
of a c object file being given as an argument to an "ocamlc -a"
command, so I am not sure what that is supposed to do, which makes it
impossible for me to understand this error message.

I am using OCaml 3.10.1 on OS X 10.4.  Any help would be appreciated.

 - Aaron


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

end of thread, other threads:[~2009-07-21 13:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-07-20 14:28 how to use c wrapper files in libraries Aaron Bohannon
2009-07-20 14:58 ` [Caml-list] " RABIH.ELCHAAR
2009-07-20 16:21   ` Aaron Bohannon
2009-07-21  8:48     ` RABIH.ELCHAAR
2009-07-21 13:26       ` Aaron Bohannon
2009-07-20 23:40 ` Erik de Castro Lopo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).