caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lally Singh <lally.singh@gmail.com>
To: Dmitry Bely <dmitry.bely@gmail.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Statically linked win32 libcamlrun.lib?
Date: Thu, 15 Apr 2010 15:16:46 -0400	[thread overview]
Message-ID: <u2r3b3449e01004151216td66901f1y569c1c9347dd3ede@mail.gmail.com> (raw)
In-Reply-To: <x2r90823c941004142359z9a5d9f8aq642735bc3db4f621@mail.gmail.com>

On Thu, Apr 15, 2010 at 2:59 AM, Dmitry Bely <dmitry.bely@gmail.com> wrote:
> On Thu, Apr 15, 2010 at 3:39 AM, Lally Singh <lally.singh@gmail.com> wrote:
>
>>  Is it possible to statically link libcamlrun.lib, so it'll work with
>> libcmtd.lib instead of msvcrt.dll?  I've tried:
>>
>> FLEXLINK=flexlink -merge-manifest -link /nodefaultlib:msvcrt.lib -link
>> libcmtd.lib
>
> Please don't use "brute force" methods. If you need statically linked
> MSVC runtime, just replace /MD with /MT (or /MTd) in config/Makefile.

Thanks, I've tried this instead, and I can't get through make -f
Makefile.nt bootstrap without:
../../boot/ocamlrun ../../ocamlc -nostdlib -I ../../stdlib -w s -c
-warn-error A -g -I ../win32unix bigarray.mli
File "bigarray.mli", line 384, characters 4-19:
Error: Unbound type constructor Unix.file_descr
make[2]: *** [bigarray.cmi] Error 2

I guess using the flexlink hack just moved whatever underlying problem
I'm having to a later stage.

>
>> in config/Makefile, and it all builds. However, I still get:
>>
>> libcamlrun.lib(sys.obj) : error LNK2019: unresolved external symbol
>> __imp__system referenced in function _caml_sys_system_command
>> libcamlrun.lib(floats.obj) : error LNK2019: unresolved external symbol
>> __imp__frexp referenced in function _caml_frexp_float
>> libcamlrun.lib(floats.obj) : error LNK2019: unresolved external symbol
>> __imp__modf referenced in function _caml_modf_float
>> libcamlrun.lib(startup.obj) : error LNK2019: unresolved external
>> symbol __imp__sscanf referenced in function _scanmult
>> libcamlrun.lib(startup.obj) : error LNK2019: unresolved external
>> symbol __imp___beginthread referenced in function _caml_main
>>
>> Any thoughts?
>
> Ocaml expects C runtime functions exported from a DLL (they have
> __implib prefix). No surprise - MSVC runtime is not a link time choice
> and requires correct compile time flags.
>
>> Sadly I have to do it this way -- we're linking a -output-obj'd .obj
>> into our DLL (which must be statically linked to the runtime) and then
>> linking libcamlrun.lib to that -- or at least hoping to.
>>
>> Thanks in advance for any help!
>
> - Dmitry Bely
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


  reply	other threads:[~2010-04-15 19:16 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-14 23:39 Lally Singh
2010-04-15  6:59 ` [Caml-list] " Dmitry Bely
2010-04-15 19:16   ` Lally Singh [this message]
2010-04-15 20:06     ` Dmitry Bely
2010-04-15 20:16     ` Dmitry Bely
2010-04-20 15:48       ` Lally Singh
2010-04-20 16:31         ` Dmitry Bely

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=u2r3b3449e01004151216td66901f1y569c1c9347dd3ede@mail.gmail.com \
    --to=lally.singh@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=dmitry.bely@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).