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: Tue, 20 Apr 2010 11:48:53 -0400	[thread overview]
Message-ID: <u2p3b3449e01004200848raaa6a253n21d9bedc17f7ea1e@mail.gmail.com> (raw)
In-Reply-To: <t2x90823c941004151316x10d5b56btcd4b89331ecb31ae@mail.gmail.com>

On Thu, Apr 15, 2010 at 4:16 PM, Dmitry Bely <dmitry.bely@gmail.com> wrote:
> On Thu, Apr 15, 2010 at 11:16 PM, Lally Singh <lally.singh@gmail.com> wrote:
>> 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.
>
> And you have to recompile flexdll_msvc.obj/flexdll_initer_msvc.obj
> with /MT option.
>
> - Dmitry Bely
Thanks, I've flushed my copy of ocaml and untarred fresh.  Replaced
all /MDs with /MTds, and rebuilt flexlink with the same procedure.

Everything seems to run now, until this:

../../boot/ocamlrun ../../tools/ocamlmklib -oc unix accept.obj
bind.obj channels.obj close.obj close_on.obj connect.obj
createprocess.obj du
p.obj dup2.obj errmsg.obj getpeername.obj getpid.obj getsockname.obj
gettimeofday.obj link.obj listen.obj lockf.obj lseek.obj nonblock.obj
m
kdir.obj open.obj pipe.obj read.obj rename.obj select.obj sendrecv.obj
shutdown.obj sleep.obj socket.obj sockopt.obj startup.obj stat.obj sy
stem.obj unixsupport.obj windir.obj winwait.obj write.obj winlist.obj
winworker.obj windbug.obj access.obj addrofstr.obj chdir.obj chmod.obj
 cst2constr.obj cstringv.obj envir.obj execv.obj execve.obj execvp.obj
exit.obj getcwd.obj gethost.obj gethostname.obj getproto.obj getserv.
obj gmtime.obj putenv.obj rmdir.obj socketaddr.obj strofaddr.obj
time.obj unlink.obj utimes.obj -ldopt ws2_32.lib
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __amsg_exit already defined
in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(crt0dat.obj) : error LNK2005: __initterm_e already defined
in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_a already defined in
msvcrt.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xi_z already defined in
msvcrt.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_a already defined in
msvcrt.lib(cinitexe.obj)
LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in
msvcrt.lib(cinitexe.obj)
LIBCMTD.lib(winxfltr.obj) : error LNK2005: ___CppXcptFilter already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(tidtable.obj) : error LNK2005: __encode_pointer already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(tidtable.obj) : error LNK2005: __encoded_null already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(tidtable.obj) : error LNK2005: __decode_pointer already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(dbghook.obj) : error LNK2005: __crt_debugger_hook already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(sprintf.obj) : error LNK2005: _sprintf already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(dosmap.obj) : error LNK2005: __errno already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(mlock.obj) : error LNK2005: __lock already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(mlock.obj) : error LNK2005: __unlock already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(typname.obj) : error LNK2005:
___clean_type_info_names_internal already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(getenv.obj) : error LNK2005: _getenv already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(osfinfo.obj) : error LNK2005: __get_osfhandle already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(osfinfo.obj) : error LNK2005: __open_osfhandle already
defined in msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(_file.obj) : error LNK2005: ___iob_func already defined in
msvcrt.lib(MSVCR90.dll)
LIBCMTD.lib(fflush.obj) : error LNK2005: __flushall already defined in
msvcrt.lib(MSVCR90.dll)
msvcrt.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)"
(??0type_info@@AAE@ABV0@@Z) alr
eady defined in LIBCMTD.lib(typinfo.obj)
msvcrt.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator=(class type_info const &)"
(??4type_info
@@AAEAAV0@ABV0@@Z) already defined in LIBCMTD.lib(typinfo.obj)
   Creating library
C:\DOCUME~1\lsingh9\LOCALS~1\Temp\dyndll_implib3ca81d.lib and object
C:\DOCUME~1\lsingh9\LOCALS~1\Temp\dyndll_implib3ca8
1d.exp
LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of
other libs; use /NODEFAULTLIB:library
LIBCMTD.lib(crt0.obj) : error LNK2019: unresolved external symbol
_main referenced in function ___tmainCRTStartup
.\dllunix.dll : fatal error LNK1120: 1 unresolved externals

I verified that every object file in that directory was compiled with
/MTd.  Is there something else I need to feed into the Makefile to
make ocamlmklib do the right thing?

Thanks for all the help!

-Lally


  reply	other threads:[~2010-04-20 15:48 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
2010-04-15 20:06     ` Dmitry Bely
2010-04-15 20:16     ` Dmitry Bely
2010-04-20 15:48       ` Lally Singh [this message]
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=u2p3b3449e01004200848raaa6a253n21d9bedc17f7ea1e@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).