caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Adrien Nader <adrien@notk.org>
To: Leonardo Laguna <modlfo@gmail.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Embedding Ocaml in a windows application
Date: Fri, 9 May 2014 14:13:24 +0200	[thread overview]
Message-ID: <20140509121324.GA26367@notk.org> (raw)
In-Reply-To: <sympa.1399619118.10331.643@inria.fr>

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

  reply	other threads:[~2014-05-09 12:13 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 [this message]
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

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=20140509121324.GA26367@notk.org \
    --to=adrien@notk.org \
    --cc=caml-list@inria.fr \
    --cc=modlfo@gmail.com \
    /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).