Subject: RE: Linking libcrt in DLL files
From: [email-masked] (Colin Peters)

5 Jun 1998 13:05:31 -0700
Message-ID: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
To: "Amsden, Zachary" <[email-masked]>
Cc: "GNU-Win32" <[email-masked]>

Amsden, Zachary <[email-masked]> wrote:

>Is it possible to link the C runtime library in DLL files?   I am trying
>to compile some
>Microsoft code from the latest platform SDK, specifically the spincube
>dll example and test.
>I am using the mingw32-gcc distrubution with the latest tools.

It is certainly possible to create DLLs that use *a* C runtime library,
including crtdll which is the default for Mingw32. I'm fairly sure this is
possible even if the calling program doesn't use the same runtime library
(though it might be a little more tricky like that in some cases).

>I can not get the DLL to compile because it complains about
>missing references to _CRT_INIT.  Checking the source code,

There doesn't seem to be any such function in any of the MSVC libraries I
have got .def files for or in crtdll. I think this warning (you must call
_CRT_INIT) may apply only to statically linked versions of the MSVC runtime.
The dynamically linked versions initialize themselves in their own,
internal, DllMain(s) (as far as I can tell). Try removing the call to
_CRT_INIT from the sample source and see if it works.

Colin.

P.S. It's nice to know about this though. Maybe I'll include a dummy
_CRT_INIT function in the mingw32 library from now on...

-- Colin Peters - colin at fu.is.saga-u.ac.jp
-- Saga Univ. Dept. of Information Science
-- http://www.geocities.com/Tokyo/Towers/6162/index.html
-- http://www.fu.is.saga-u.ac.jp/~colin/index.html

-
For help on using this list (especially unsubscribing), send a message to
"[email-masked]" with one line of text: "help".