delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/01/17:12:04

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-Id: <199911012210.QAA24789@pluto.xraylith.wisc.edu>
To: "Daniel C. Sinclair" <uf657 AT victoria DOT tc DOT ca>
cc: Colin Peters <colinp AT ma DOT kcom DOT ne DOT jp>,
GNU-win32 <cygwin AT sourceware DOT cygnus DOT com>
Subject: Re: mingw32 DLL getting main args?
In-Reply-To: Your message of "Mon, 01 Nov 1999 04:16:38 PST."
<Pine DOT GSO DOT 3 DOT 95 DOT iB1 DOT 0 DOT 991101040605 DOT 20874A-100000 AT vtn1>
Date: Mon, 01 Nov 1999 16:10:47 -0600
From: Mumit Khan <khan AT thor DOT xraylith DOT wisc DOT edu>

"Daniel C. Sinclair" <uf657 AT victoria DOT tc DOT ca> writes:
> 
> Many Win32 functions do the same thing as the C runtime functions. I'm
> using some of those. I have heard that a program and DLL should not use a
> different C runtime DLL - bad things can happen. My DLL will be used by
> many people with different compilers, even different languages. So I don't
> want my DLL importing anything from a C runtime DLL. 
> 
> Daniel

Daniel,

I did take out the _argv and _argc code from DLL, but then I realized that
the DLL will never be independent of the runtime, simply because there are
calls to malloc/free within the compiler/language support library (libgcc),
part of which is embedded in each executable and DLL.

MSVC++ does the same, and any DLL created with VC++ will also depend on
MSVCRT.DLL. It should be easy to convince yourself of that.

Until someone is willing to write a small memory manager just for the 
runtime and hence make it independent of either MSVCRT.DLL or CRTDLL.DLL,
I'm afraid the situation is unlikely to change.

As for mixing runtimes, just create a DLL that depends on MSVCRT.DLL, which
is the case for just about all native DLLs. Use the msvcrt add-on package
instead of the default CRTDLL one.

Regards,
Mumit


--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019