Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Florent Monnier <fmonnier@linux-nantes.fr.eu.org>
To: caml-list@inria.fr
Subject: Caml with main in C  + .cmxa
Date: Fri, 3 Feb 2006 16:13:13 +0100	[thread overview]
Message-ID: <200602031613.13954.fmonnier@linux-nantes.fr.eu.org> (raw)

Hi,

I'm compiling the beginning of a small app written in OCaml but with the main 
which boot the app in C.
The OCaml app should also use a .cmxa lib, which is a binding to a C lib.

Without the .cmxa binding, compiling works good with this:

% ocamlopt -c  app.ml
% ocamlopt -output-obj -o mlobj.o  unix.cmxa  app.cmx
% gcc main.c  -o myapp.opt  mlobj.o \
        -I'/usr/local/lib/ocaml' \
        -L/usr/local/lib/ocaml \
        -lunix -lasmrun  -lm -ldl


But now I'm trying to figure out how to compile with the .cmxa
which is the binding to ImageMagick  (hump ~contrib:487)

To compile C code without caml pieces with the libMagick is done this way:
gcc `Magick-config --cflags --cppflags` app.c `Magick-config --ldflags --libs`

So here is my attempt to mix all together:

% ocamlopt -c  -I +libMagick  magick.cmxa   app.ml
% ocamlopt -output-obj -o mlobj.o unix.cmxa -I +libMagick magick.cmxa  app.cmx
(untill there, no error messages)

% gcc `Magick-config --cflags --cppflags`  main.c  -o myapp.opt  mlobj.o \
        -I'/usr/local/lib/ocaml' \
        -L/usr/local/lib/ocaml \
        -lunix -lasmrun  -lm -ldl \
        `Magick-config --ldflags --libs`

and then with this last command, I get about 200 errors like this:
--------------------
mlobj.o: In function `camlMagick__scale_1177':
: undefined reference to `fun_scaleimage'

mlobj.o: In function `camlMagick__sharpen_1136':
: undefined reference to `fun_sharpenimage'

mlobj.o: In function `camlMagick__blur_channel_1193':
: undefined reference to `fun_blurimagechannel'
--------------------

'fun_scaleimage' and the others are the names of the functions in
the C file of the OCaml-libMagick binding.



So what is the error I have done?
What should I correct to get the app compliled?


-- 
Thanks in advance
Florent Monnier


             reply	other threads:[~2006-02-03 15:04 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-03 15:13 Florent Monnier [this message]
2006-02-03 18:41 ` [Caml-list] " Florent Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200602031613.13954.fmonnier@linux-nantes.fr.eu.org \
    --to=fmonnier@linux-nantes.fr.eu.org \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox