caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Embedding Ocaml in a windows application
@ 2014-05-09  7:42 Leonardo Laguna
  2014-05-09 12:13 ` Adrien Nader
  0 siblings, 1 reply; 8+ messages in thread
From: Leonardo Laguna @ 2014-05-09  7:42 UTC (permalink / raw)
  To: caml-list

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.

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?

I wonder if it’s possible to do a kind of cross-compilation of Ocaml 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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-05-09 22:00 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-09  7:42 [Caml-list] Embedding Ocaml in a windows application Leonardo Laguna
2014-05-09 12:13 ` Adrien Nader
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

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).