caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Charles Neveu <neveu@artemis.arc.nasa.gov>
To: caml-list@inria.fr
Subject: linking ocaml in multithreaded shared dll app
Date: Tue, 07 Nov 2000 11:19:08 -0800	[thread overview]
Message-ID: <3A0855AC.77F9C627@artemis.arc.nasa.gov> (raw)

I'm trying to link the ocaml library into a Windows NT 4.0, MS VC++ 6.0
application that uses MFC in a shared dll (because another library,
OpenInventor, has to be linked this way).
I'm getting an unresolved external symbol error for the symbols
__pctype, ___mb_cur_max, and __dosmaperr from files like win32.obj,
read.obj, write.obj, etc. (complete text at bottom). 

I'm not a MSVC++ expert, but I'm guessing that the libunix library is
compiled to be linked with a statically-linked MFC library. Is this
right? Is there anyway to compile it to link to a dynamically-linked MFC
library?

Or is there something else going on?

Charles

Here is the linker output (ignore the first few Maestro errors, I'm
porting that):
--------------------Configuration: talkdll - Win32
Debug--------------------
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
"_MBCS" /D "_AFXDLL" /Fp"Debug/talkdll.pch" /Yc"stdafx.h" /Fo"Debug/"
/Fd"Debug/" /FD /GZ /c 
   "E:\neveu\Development\talkdll\StdAfx.cpp"
StdAfx.cpp
Note: reusing persistent precompiled header 
Compiling...
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for
80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
cl /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D
"_MBCS" /D "_AFXDLL" /Fp"Debug/talkdll.pch" /Yu"stdafx.h" /Fo"Debug/"
/Fd"Debug/" /FD /GZ /c 
   "E:\neveu\Development\talkdll\Mbr.cpp"
   "E:\neveu\Development\talkdll\talkdll.cpp"
   "E:\neveu\Development\talkdll\talkdllDlg.cpp"
Skipping... (no relevant changes detected)
Mbr.cpp
talkdll.cpp
talkdllDlg.cpp
Linking...
msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "public: class ostream &
__thiscall ostream::operator<<(class ostream & (__cdecl*)(class ostream
&))" (??6ostream@@QAEAAV0@P6AAAV0@AAV0@@Z@Z) already defined in
libmae-nt.lib(Maestro_Types.obj)
msvcirtd.lib(MSVCIRTD.dll) : error LNK2005: "class ostream & __cdecl
endl(class ostream &)" (?endl@@YAAAVostream@@AAV1@@Z) already defined in
libmae-nt.lib(Maestro_Types.obj)
libmae-nt.lib(Maestro_GroupMember.obj) : error LNK2001: unresolved
external symbol "class ostream_withassign  cerr"
(?cerr@@3Vostream_withassign@@A)
libmae-nt.lib(Maestro_GroupMember.obj) : error LNK2001: unresolved
external symbol "class ostream_withassign  cout"
(?cout@@3Vostream_withassign@@A)
libmae-nt.lib(win32.obj) : error LNK2001: unresolved external symbol
__pctype
libmae-nt.lib(win32.obj) : error LNK2001: unresolved external symbol
___mb_cur_max
libmae-nt.lib(read.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(write.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(close_on.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(createprocess.obj) : error LNK2001: unresolved external
symbol __dosmaperr
libmae-nt.lib(spawn-nt.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(dup.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(lseek.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(open.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(close.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(dup2.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(pipe.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(winwait.obj) : error LNK2001: unresolved external symbol
__dosmaperr
libmae-nt.lib(envir.obj) : error LNK2001: unresolved external symbol
__environ
libmae-nt.lib(execvp.obj) : error LNK2001: unresolved external symbol
__environ
Debug/talkdll.exe : fatal error LNK1120: 6 unresolved externals
Error executing link.exe.

talkdll.exe - 21 error(s), 0 warning(s)

-- 
Dr. Charles Frederick Neveu     T: 650 604-2525
Autonomy and Robotics Group     F: 650 604-4036
NASA Ames Research Center       E: neveu@artemis.arc.nasa.gov
Mail Stop 269-4                 W: http://img.arc.nasa.gov/~neveu
Moffett Field, CA 94035-1000



             reply	other threads:[~2000-11-08 17:28 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-07 19:19 Charles Neveu [this message]
2000-11-09 13:28 ` Lionel Fourquaux
2000-11-10  2:37   ` Ken Wakita
2000-12-14  3:53   ` Charles Neveu
2000-12-14 18:51     ` Xavier Leroy

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=3A0855AC.77F9C627@artemis.arc.nasa.gov \
    --to=neveu@artemis.arc.nasa.gov \
    --cc=caml-list@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).