caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@mailhost.math.nagoya-u.ac.jp>
To: roessler@rftp.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlopt and *using* DLLs
Date: Tue, 24 May 2005 13:29:51 +0900 (JST)	[thread overview]
Message-ID: <20050524.132951.104054009.garrigue@mailhost.math.nagoya-u.ac.jp> (raw)
In-Reply-To: <4292A58D.207@rftp.com>

From: Robert Roessler <roessler@rftp.com>

> I tried this on the beginners list, but may not have been asking the 
> right question(s)... :)

Doesn't look like a beginner question...

> 1) Can DLLs appear as input to the ocamlopt compiler like they can 
> with ocamlc?  The manual says "yes": "Arguments ending in .o, .a or 
> .so (.obj, .lib and .dll under Windows) are assumed to be C object 
> files and libraries. They are linked with the program."
> 
> I get "ocamlopt.opt: don't know what to do with ml_scintilla.dll."

Indeed, looking at the sources, .so/.dll is only handled in ocamlc,
not in ocamlopt.
That means that, in ocamlopt, you must either provide a static
library, or use the -cclib option and hope that the system linker does
the right thing. In practice, -cclib ml_scintilla.so should work on
Unix, but the .dll equivalent is not going to work on Windows, as the
linker does not support it.

> 2) If DLLs can in fact be used with ocamlopt, is the model the same as 
> with ocamlc?  In particular,
> 
> 2a) can I use them *without* stub libraries?

If by stub you mean the ml_scintilla.lib that the windows librarian
builds for you, then you will need it with ocamlopt (but not with
ocamlc).
Of course in both cases you also need an ocaml specific stub library
to wrap calls.

> 2b) can I in general expect that an app that works well with ocamlc 
> and a collection of OCaml cma libs and compiled DLLs (LablGTK and 
> associated runtime) will work with ocamlopt - assuming that I generate 
> and replace cmo/cma files with cmx/cmxa files?

Except these linking problems, you can assume identical behaviour.
If there are significant discrepancies, please report them.

Jacques Garrigue


  reply	other threads:[~2005-05-24  4:30 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-24  3:54 Robert Roessler
2005-05-24  4:29 ` Jacques Garrigue [this message]
2005-05-24  6:39   ` [Caml-list] " Robert Roessler
2005-05-24  7:10     ` Nicolas Cannasse
2005-05-27  1:50       ` Robert Roessler
     [not found]       ` <42967B63.8040408@rftp.com>
     [not found]         ` <02ce01c56355$14c93db0$19b0e152@warp>
2005-06-01 20:32           ` Robert Roessler
     [not found]             ` <0d4f01c56702$94853300$0300a8c0@DBLSYG61>
2005-06-02  4:24               ` Robert Roessler
2005-05-27  2:13   ` Robert Roessler
2005-05-27  8:17     ` Anatoly Zaretsky
2005-05-28  6:42       ` Nicolas Cannasse
2005-05-24  5:06 ` Nicolas Cannasse
2005-05-27  1:50   ` Robert Roessler

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=20050524.132951.104054009.garrigue@mailhost.math.nagoya-u.ac.jp \
    --to=garrigue@mailhost.math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=roessler@rftp.com \
    /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;
as well as URLs for NNTP newsgroup(s).