caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Leonardo Laguna <modlfo@gmail.com>
To: Adrien Nader <adrien@notk.org>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Embedding Ocaml in a windows application
Date: Sat, 10 May 2014 00:00:28 +0200	[thread overview]
Message-ID: <CAF=ojbVVvwL4QyZc2Ud5J7h9OwCM7nx=YtO7dJ_1_WTG-pPDWg@mail.gmail.com> (raw)
In-Reply-To: <20140509215421.GA26545@notk.org>

[-- Attachment #1: Type: text/plain, Size: 1590 bytes --]

Hi Adrien,

I have changed to other computer and I could compile the msvc port of
Ocaml. This time I didn't had any problem. I don't know what was wrong with
my other computer.

Now using ocamlopt (instead of flexlink) and the libasmrun.lib works fine.

Thank you very much for your help.

Leonardo


On Fri, May 9, 2014 at 11:54 PM, Adrien Nader <adrien@notk.org> wrote:

> On Fri, May 09, 2014, Leonardo Laguna wrote:
> > This is what I'm executing:
> >
> > ocamlopt -output-obj -o ocamllibrary.o library.ml
> > cl /c my_plugin.c /I"C:\\wodi32\\opt\\wodi32\\lib\\ocaml\\std-lib"
> > cl /c ocaml_stub.c /I"C:\\wodi32\\opt\\wodi32\\lib\\ocaml\\std-lib"
> > flexlink -chain msvc -exe -o my_plugin.exe my_plugin.obj ocaml_stub.obj
> > ocamllibrary.o plug.lib -lasmrun -lgcc -L
> > "C:\wodi32\lib\gcc\i686-w64-mingw32\4.8.2"
>
> My take on it (as you can see, it's really mine) would be something
> like (with an ocaml toolchain based on the mingw port):
>
> ocamlopt -output-obj -o ocamllibrary.o library.ml
> ocamlc -c my_plugin.c
> ocamlc -c ocaml_stub.c
> ocamlopt -o my_plugin.exe ocaml_stub.o my_plugin.o ocamllibrary.o plug.lib
>
> The ideas behind this are:
> - gcc and msvc create compatible object files even though they have a
>   different extension
> - static libraries are archives of objects and are also usable directly
> - the ocaml compiler knows best how to call the C compiler for C files;
>   calling the C compiler by hand is an endless source of pain (if you
>   want more details, add -verbose to the ocaml* invocations)
> - same for the linker
>
> --
> Adrien Nader
>

[-- Attachment #2: Type: text/html, Size: 2364 bytes --]

      reply	other threads:[~2014-05-09 22:00 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-09  7:42 Leonardo Laguna
2014-05-09 12:13 ` Adrien Nader
2014-05-09 20:16   ` Leonardo Laguna
2014-05-09 20:20     ` Adrien Nader
2014-05-09 20:27       ` Leonardo Laguna
2014-05-09 20:40         ` David Allsopp
2014-05-09 21:54         ` Adrien Nader
2014-05-09 22:00           ` Leonardo Laguna [this message]

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='CAF=ojbVVvwL4QyZc2Ud5J7h9OwCM7nx=YtO7dJ_1_WTG-pPDWg@mail.gmail.com' \
    --to=modlfo@gmail.com \
    --cc=adrien@notk.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;
as well as URLs for NNTP newsgroup(s).