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 550017ED9B for ; Fri, 9 May 2014 14:13:26 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of adrien@notk.org) identity=pra; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of adrien@notk.org designates 91.121.71.147 as permitted sender) identity=mailfrom; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="adrien@notk.org"; 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@nautica.notk.org) identity=helo; client-ip=91.121.71.147; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="adrien@notk.org"; x-sender="postmaster@nautica.notk.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhIFAKTFbFNbeUeT/2dsb2JhbABZgwaEDsJfAYEYFnSCJQEBBAEjDwFGBQsLDgoCAgUTDgICDwUYHQETiEwMrD2kbBeBKo0oB4J1NoEVBJVPg3cBkwKDODs X-IPAS-Result: AhIFAKTFbFNbeUeT/2dsb2JhbABZgwaEDsJfAYEYFnSCJQEBBAEjDwFGBQsLDgoCAgUTDgICDwUYHQETiEwMrD2kbBeBKo0oB4J1NoEVBJVPg3cBkwKDODs X-IronPort-AV: E=Sophos;i="4.97,1018,1389740400"; d="scan'208";a="72857318" Received: from nautica.notk.org ([91.121.71.147]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 09 May 2014 14:13:26 +0200 Received: by nautica.notk.org (Postfix, from userid 1003) id DCD31C009; Fri, 9 May 2014 14:13:24 +0200 (CEST) Date: Fri, 9 May 2014 14:13:24 +0200 From: Adrien Nader To: Leonardo Laguna Cc: caml-list@inria.fr Message-ID: <20140509121324.GA26367@notk.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [Caml-list] Embedding Ocaml in a windows application Hi, On Fri, May 09, 2014, Leonardo Laguna wrote: > Hello, > > I’m trying to make a plugin for a third party application using Ocaml. This > plugin is a shared library that is usually written in C, so you take your C > code and link it with a static library (provided by the software vendor) in > order to get a shared library that can be loaded by the application. I made a > small test in OSX that embeds Ocaml (as shown in ‘Interoperability with C’ of > the book ‘Developing applications with Objective Caml’) and works fine. > However in windows I’m running into problems. > > The shared library that the vendor provides is compiler with VC++, therefore > is not possible to link object files produced by the Cygwin neither MinGW > port. For that reason I tried to compile the MSVC port of Ocaml and I didn’t > succeed. Depends: if the library is C then you can perfectly mix the two compilers. Keep in mind that when you build with GCC on Windows, you're still using the Windows libraries like msvcrt.dll or kernel32.dll and they've been built using MSVC. > I followed the instructions in the README.win32. The first problem I had was > that flexlink was not able to call ‘link’, so I downloaded the flexlink code > and changed it to call instead ‘link.exe’, this worked. Then flexlink could > not handle Cygwin paths like ‘/tmp/’or ‘/cygdrive/c/’ . I modified the code so > it replaces the Cygwin paths to Windows paths. It worked. I continued until I > got the message that the ‘ml’ command does not exist. The environment is set > correctly and I can call ‘ml’ from the terminal. > > Has anyone tried to compile the MSVC port lately? IIRC even the MSVC port is built from Cygwin and I think it won't mind whether there are trailing '.exe' or not. But now I'm not sure I understand: what is calling flexlink? Is it your build system or the ocaml compiler's? -- Adrien Nader