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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 0C5D77ED9B for ; Fri, 9 May 2014 22:27:33 +0200 (CEST) Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of modlfo@gmail.com) identity=pra; client-ip=209.85.216.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="modlfo@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of modlfo@gmail.com designates 209.85.216.172 as permitted sender) identity=mailfrom; client-ip=209.85.216.172; receiver=mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-qc0-f172.google.com) identity=helo; client-ip=209.85.216.172; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="modlfo@gmail.com"; x-sender="postmaster@mail-qc0-f172.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkcCADM5bVPRVdislGdsb2JhbABZg1VYgmeoTgEGgmWONYh+AYESCBYOAQEBAQcLCwkSKoIlAQEEASMdARsdAQMBCwYFBAcNKgICIgERAQUBHAYTiCwBAwkIoFKMEVGDDZlvChknDWSFOxEBBQyFSoh8B4J1gUsEmUeBPItkg3EYKYRoOw X-IPAS-Result: AkcCADM5bVPRVdislGdsb2JhbABZg1VYgmeoTgEGgmWONYh+AYESCBYOAQEBAQcLCwkSKoIlAQEEASMdARsdAQMBCwYFBAcNKgICIgERAQUBHAYTiCwBAwkIoFKMEVGDDZlvChknDWSFOxEBBQyFSoh8B4J1gUsEmUeBPItkg3EYKYRoOw X-IronPort-AV: E=Sophos;i="4.97,1020,1389740400"; d="scan'208";a="61250154" Received: from mail-qc0-f172.google.com ([209.85.216.172]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 09 May 2014 22:27:32 +0200 Received: by mail-qc0-f172.google.com with SMTP id l6so5269826qcy.3 for ; Fri, 09 May 2014 13:27:30 -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=Xnh2UCTkhBIL4REgdK+in+Dktv1ob4EAQUruFe9CS24=; b=DT9meYdwer9LT5vUsF/4gU1eyrVyOq+gHw7tfPcPC3eDePkLE5CGR9inLoBb7URJ2X PeNJ9mLNLwGhj7czsvU8cK7978BC+69xjG0xj1F/iqnvn7HwwhncgtEnoyoW+Hu/+PpA 16dUF9eRSK43EMSt/t1xeT1trzuaPJ5vmGofCbY+3tx/bj9KxZKx5uElxpyp8MqX+ipP L1+IvwUirtWqaxFxm4KteL4yNreOTB8ilLnTYzFUukwEgL8umXXLhVO7Zc0KLMni4k10 /+OaSOZyj6uKlgYLBoACU/bl9WlUdAcgphB7QundgeC2P0hnqgqfqsZaPIHTlr+xBWG3 NkfQ== MIME-Version: 1.0 X-Received: by 10.224.6.10 with SMTP id 10mr18065387qax.45.1399667250846; Fri, 09 May 2014 13:27:30 -0700 (PDT) Received: by 10.224.123.14 with HTTP; Fri, 9 May 2014 13:27:30 -0700 (PDT) In-Reply-To: <20140509202046.GA17828@notk.org> References: <20140509121324.GA26367@notk.org> <20140509202046.GA17828@notk.org> Date: Fri, 9 May 2014 22:27:30 +0200 Message-ID: From: Leonardo Laguna To: Adrien Nader Cc: caml-list@inria.fr Content-Type: multipart/alternative; boundary=001a11c2b9944a7d1904f8fd6d41 Subject: Re: [Caml-list] Embedding Ocaml in a windows application --001a11c2b9944a7d1904f8fd6d41 Content-Type: text/plain; charset=UTF-8 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" Leonardo On Fri, May 9, 2014 at 10:20 PM, Adrien Nader wrote: > On Fri, May 09, 2014, Leonardo Laguna wrote: > > I have given up on compiling the msvc port. I don't know why I'm getting > > errors when the '.exe' is not there. > > > > I will try to explain better what I want to do. > > > > I have the following files: > > > > - plug.lib (provided by the software vendor, closed source, compiled with > > VC++), in OSX I have plug.a > > - my_main.c (the code for the plugin) > > - ocaml_stub.c (this code calls 'caml_startup()') > > - ocaml_code.ml > > > > in OSX I compile my_main.c, ocaml_stub.c and ocaml_code.ml to obtain > '.o' > > files. Then I link the .o files with plug.a and libasmrun.a. This works > > fine. > > > > In windows I have wodi32, visual studio 2008 and Flexdll. I tried the > > following. > > - Using cl compile, ocaml_stub.c, my_main.c to obtain '.obj' files > > - Using ocamlopt, compile ocaml_code.ml to obtain a '.o' file > > - Using flexlink to link the .obj, .o, libasmrun.a, plug.lib, libgcc.a > and > > libc.a > > > > This gives me an error: > > > > ** Cannot resolve symbols for libasmrun.a(floats.o): > > ___strtod > > > > I have tried to create my own strtod function and link it does not pick > it. > > > > Anybody knows how can I link my program. > > Can you provide the commands? In particular the flexlink one? > > Also you probably shouldn't call flexlink directly; using ocamlc should > do it. > > -- > Adrien Nader > --001a11c2b9944a7d1904f8fd6d41 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This is what I'm executing:

oc= amlopt -output-obj -o ocamllibrary.o library.= ml
cl /c my_plugin.c /I"C:\\wodi32\\opt\\wodi32\\lib\\oc= aml\\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.obj ocamllibrary.o plug.lib -lasmrun -lgcc -L "C:\wodi32\li= b\gcc\i686-w64-mingw32\4.8.2"

Leonardo



On Fri, May 9, 2014 at 10:2= 0 PM, Adrien Nader <adrien@notk.org> wrote:
On Fri, May 09, 2014, Leonar= do Laguna wrote:
> I have given up on compiling the msvc port. I do= n't know why I'm getting
> errors when the '.exe' is not there.
>
> I will try to explain better what I want to do.
>
> I have the following files:
>
> - plug.lib (provided by the software vendor, closed source, compiled w= ith
> VC++), in OSX I have plug.a
> - my_main.c (the code for the plugin)
> - ocaml_stub.c (this code calls 'caml_startup()')
> - ocaml_code.ml=
>
> in OSX I compile my_main.c, ocaml_stub.c and ocaml_code.ml to obtain '.o'
> files. Then I link the .o files with plug.a and libasmrun.a. This work= s
> fine.
>
> In windows I have wodi32, visual studio 2008 and Flexdll. I tried the<= br> > following.
> - Using cl compile, ocaml_stub.c, my_main.c to obtain '.obj' f= iles
> - Using ocamlopt, compile ocaml_code.ml to obtain a '.o' file
> - Using flexlink to link the .obj, .o, libasmrun.a, plug.lib, libgcc.a= and
> libc.a
>
> This gives me an error:
>
> ** Cannot resolve symbols for libasmrun.a(floats.o):
> =C2=A0___strtod
>
> I have tried to create my own strtod function and link it does not pic= k it.
>
> Anybody knows how can I link my program.

Can you provide the commands? In particular the flexlink one?

Also you probably shouldn't call flexlink directly; using ocamlc should=
do it.

--
Adrien Nader

--001a11c2b9944a7d1904f8fd6d41--