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 0B9DB7ED9B for ; Fri, 9 May 2014 09:42:21 +0200 (CEST) X-IronPort-AV: E=Sophos;i="4.97,1016,1389740400"; d="scan'208";a="72821558" Received: from sympa.inria.fr ([193.51.193.213]) by mail2-relais-roc.national.inria.fr with ESMTP; 09 May 2014 09:42:20 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id F188C7EE5C; Fri, 9 May 2014 09:42:20 +0200 (CEST) Date: Fri, 09 May 2014 09:42:16 +0200 To: caml-list@inria.fr Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: QUOTED-PRINTABLE From: "Leonardo Laguna" X-Mailer: Sympa 6.1.17 Subject: [Caml-list] Embedding Ocaml in a windows application Hello, I=E2=80=99m trying to make a plugin for a third party application using Oca= ml. 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 mad= e a small test in OSX that embeds Ocaml (as shown in =E2=80=98Interoperability= with C=E2=80=99 of the book =E2=80=98Developing applications with Objective Caml=E2=80=99) and= works fine. However in windows I=E2=80=99m 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= =E2=80=99t succeed. I followed the instructions in the README.win32. The first problem I had was that flexlink was not able to call =E2=80=98link=E2=80=99, so I downloaded = the flexlink code and changed it to call instead =E2=80=98link.exe=E2=80=99, this worked. The= n flexlink could not handle Cygwin paths like =E2=80=98/tmp/=E2=80=99or =E2=80=98/cygdrive/c= /=E2=80=99 . I modified the code so it replaces the Cygwin paths to Windows paths. It worked. I continued until= I got the message that the =E2=80=98ml=E2=80=99 command does not exist. The e= nvironment is set correctly and I can call =E2=80=98ml=E2=80=99 from the terminal. Has anyone tried to compile the MSVC port lately? I wonder if it=E2=80=99s possible to do a kind of cross-compilation of Ocam= l code, like, taking the cygwin Ocaml compiler and tell it to use the MSVC tools for the final executable or object files. Is there any chance to get my plugin working on windows? Thank you beforehand, Leonardo