From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 4ADDA7ED9B for ; Sat, 10 May 2014 00:00:30 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of modlfo@gmail.com) identity=pra; client-ip=209.85.216.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="modlfo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of modlfo@gmail.com designates 209.85.216.175 as permitted sender) identity=mailfrom; client-ip=209.85.216.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="modlfo@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f175.google.com) identity=helo; client-ip=209.85.216.175; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="postmaster@mail-qc0-f175.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtoBADNPbVPRVdivm2dsb2JhbABZg1VYgmeoTgaaGAGBEggWDgEBAQEBBgsLCRQogiUBAQQBIx0BGx0BAwELBgUEBw0qAgIiAREBBQEcBhOILAEDCQigQ4wRUYMNmXUKGScNZIU7EQEFDIVKiHwHgnWBSwSZR4E8j1UYKYRoOw X-IPAS-Result: AtoBADNPbVPRVdivm2dsb2JhbABZg1VYgmeoTgaaGAGBEggWDgEBAQEBBgsLCRQogiUBAQQBIx0BGx0BAwELBgUEBw0qAgIiAREBBQEcBhOILAEDCQigQ4wRUYMNmXUKGScNZIU7EQEFDIVKiHwHgnWBSwSZR4E8j1UYKYRoOw X-IronPort-AV: E=Sophos;i="4.97,1020,1389740400"; d="scan'208";a="72914637" Received: from mail-qc0-f175.google.com ([209.85.216.175]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/RC4-SHA; 10 May 2014 00:00:29 +0200 Received: by mail-qc0-f175.google.com with SMTP id w7so5356239qcr.34 for ; Fri, 09 May 2014 15:00:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=Sjfnbk/wSuKEUZCPx1dm//kkNcW/JYrZT/OJCExCBBw=; b=R3L8Nut6yPe2CpIdOaVEDHii5/coUrO2CHvmsS+XBTDuCQQhori0gnIz0NYcGuEbqs hh5ao0YTSxXUAc8GfchpYeN1CXgqxmEp+YSCS8EaxoIDYn0Ff7IMvXMrXiumSPxikt9S ApIodTr1Pb62LmhkFhYBtvKGkCAou7Ot/UxY00Qiws4jQovRT6JItQtLb0elUMDDFv0Q fvDjh/YbybgdrtZqika6LppLFV7Wdx4rlSTrJmRxrq2wk3mBvAUV8VMCORBN9GoH7nUF PXohZz2UGt8UCZ0mcYasmCcw7Pfn6jpyDff5rjgEWNQD5JM3UabsLqNaLE8b6olw+fOn fc7g== MIME-Version: 1.0 X-Received: by 10.224.30.70 with SMTP id t6mr18283257qac.30.1399672828783; Fri, 09 May 2014 15:00:28 -0700 (PDT) Received: by 10.224.123.14 with HTTP; Fri, 9 May 2014 15:00:28 -0700 (PDT) In-Reply-To: <20140509215421.GA26545@notk.org> References: <20140509121324.GA26367@notk.org> <20140509202046.GA17828@notk.org> <20140509215421.GA26545@notk.org> Date: Sat, 10 May 2014 00:00:28 +0200 Message-ID: From: Leonardo Laguna To: Adrien Nader Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=047d7bdca66ac2f15504f8feb98b Subject: Re: [Caml-list] Embedding Ocaml in a windows application --047d7bdca66ac2f15504f8feb98b Content-Type: text/plain; charset=UTF-8 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 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 > --047d7bdca66ac2f15504f8feb98b Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Adrien,

I have changed to other comp= uter 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.=C2=A0=

Now using ocamlopt (instead of flexlink) and the libasm= run.lib works fine.=C2=A0

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-li= b"
> flexlink -chain msvc -exe -o my_plugin.exe my_plugin.obj ocaml_stub.ob= j
> 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 somethi= ng
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<= br>
The ideas behind this are:
- gcc and msvc create compatible object files even though they have a
=C2=A0 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;
=C2=A0 calling the C compiler by hand is an endless source of pain (if you<= br> =C2=A0 want more details, add -verbose to the ocaml* invocations)
- same for the linker

--
Adrien Nader

--047d7bdca66ac2f15504f8feb98b--