caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jerome Simeon <simeon@research.bell-labs.com>
To: Xavier Leroy <xavier.leroy@inria.fr>
Cc: Dmitry Bely <dbely@mail.ru>, caml-list@inria.fr
Subject: Re: [Caml-list] ocamlmklib on Windows
Date: 18 Jul 2003 19:40:44 -0400	[thread overview]
Message-ID: <1058571633.27312.162.camel@localhost.localdomain> (raw)
In-Reply-To: <20030718181835.A31913@pauillac.inria.fr>

I would be interested to follow the discussion. DLL/Dynamic linking is
currently one of the main problem we have in Galax.

Our (surprisingly ambitious) goal was to to wrap Caml code transparently
behind a C/C++/Java API. The Java part requires dynamic linking. Here
were our results so far:

 (1) Things worked ok on Linux and on most other Unix-gcc based systems
we tried, although finding the right compiler flags was sometime tricky
(why on earth is the '-mimpure-text' needed under Solaris?).

 (2) It took us more than two weeks to get some dynamic linking going
with the MinGW port of Caml, and it only worked so far with the bytecode
runtime. I'm still trying to figure out what goes wrong for the
nativecode. I was starting to think we should try with the VC++ port,
but the current discussion seems to indicate its another big mess.

 (3) Dynamic linking does not work under MacOS X.

Any chance of things improving in the near future? My dream would be
some kind of compilation magic to wrap Caml inside a C dynamic library,
but improvements on (2) and (3) above would already be a big help.

Thanks,
- Jerome Simeon

On Fri, 2003-07-18 at 12:18, Xavier Leroy wrote:
> > That don't seems to be correct. Dynamic and static libs can be linked
> > with any Win32 compiler from the same set of object files. To illustrate
> > this, just let me quote myself
> 
> At least with the version of VC++ I use, your example stops working
> when you put the .obj files *in a static library* (which is the point
> of the exercise):
> 
>   cl -c -MD lib.c
>   # static linking
>   cl -MD main.c lib.obj
>   # LINK : warning LNK4049: locally defined symbol "_x" imported
>   # but main.exe still works (the warhing can be supressed)
>   # static linking via a static lib
>   lib /out:staticlib.lib lib.obj
>   cl -MD main.c staticlib.lib
>   # main.obj : error LNK2001: unresolved external symbol __imp__x
>   # main.exe : fatal error LNK1120: 1 unresolved externals
> 
> If you know how to work around this, that'd be great.  I'd suggest we
> take this discussion off caml-list, though, as DLL hackery is getting
> out of topic.
> 
> - Xavier Leroy
> 
> -------------------
> To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
> Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
-- 
Jerome Simeon <simeon@research.bell-labs.com>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


      reply	other threads:[~2003-07-18 22:39 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-16 15:07 Richard Jones
2003-07-17 20:37 ` Xavier Leroy
2003-07-18 14:00   ` Richard Jones
2003-07-18 14:12     ` Xavier Leroy
     [not found] ` <isq0rl4h.fsf@totally-fudged-out-message-id>
2003-07-18 15:26   ` Dmitry Bely
2003-07-18 16:18     ` Xavier Leroy
2003-07-18 23:40       ` Jerome Simeon [this message]

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=1058571633.27312.162.camel@localhost.localdomain \
    --to=simeon@research.bell-labs.com \
    --cc=caml-list@inria.fr \
    --cc=dbely@mail.ru \
    --cc=xavier.leroy@inria.fr \
    /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).