This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: mingw32 DLL getting main args?


"Daniel C. Sinclair" <uf657@victoria.tc.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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]