Google Answers Logo
View Question
 
Q: MSVCRT.dll versus MSVCRT40.dll ( Answered 4 out of 5 stars,   0 Comments )
Question  
Subject: MSVCRT.dll versus MSVCRT40.dll
Category: Computers > Programming
Asked by: jonathanclark-ga
List Price: $4.00
Posted: 30 Jun 2002 14:31 PDT
Expires: 30 Jul 2002 14:31 PDT
Question ID: 35253
I use the C Runtime library as a DLL as the size of my programs are
very important. Typically this is done by linking with msvcrt.lib
which is an import library for msvcrt.dll. This will require that
msvcrt.dll be present on the computer loading your program.  However,
the default installation of Windows 95 does not install msvcrt.dll -
it does install msvcrt40.dll which appears to be for the most part
functionally equivilent.  On Windows 95 msvcrt40.dll contains the C
runtime functionality, and on other versions of windows (98+),
msvcrt40.dll is a forwarding DLL to msvcrt.dll.  So, it would appear
that in order to make a program load properly on every version of
windows, one would want to link with msvcrt40.dll.

I'm using Visual Studio 6.0 and it does not contail an import library
for msvcrt40.dll (i.e. msvcrt40.lib).  Searching the web I was unable
to find this file either, but there appear to be a number of programs
that use msvcrt40.dll so it must exsist somewhere.  My question is,
where can I find msvcrt40.lib or is there any other way for my to link
against msvcrt40.dll instead of msvcrt.dll.

This seems to indicate that msvcrt40.lib is included with Visual
Studio 4.0, where can I get a copy of Visual Studio 4.0?  Or perhaps
someone reading this has a copy of the library in question.
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q154591

 I'm not interested in other solutions such as installing a copy
msvcrt.dll with my program or linking statically with msvcrt.
Answer  
Subject: Re: MSVCRT.dll versus MSVCRT40.dll
Answered By: blader-ga on 30 Jun 2002 14:52 PDT
Rated:4 out of 5 stars
 
Dear jonathanclark:

Thank you for your question. From what I have found, there is no
import library file named msvcrt40.lib. From a newsgroup posting by a
MSFT employee:

"The import library for the CRT dll has always been named msvcrt.lib
and
msvcrtd.lib, even when the DLL was called msvcrt40.dll. Its just been
convention and prevents you from having to change makefiles around
from
version to version..."
http://www.dotnet247.com/247reference/msgs/1/7824.aspx

A MSDN article also supports this fact:
"The MSVCRT.LIB library, which calls code in the shared MSVCRT40.DLL,
is also reentrant."
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_library_support_for_multithreading.asp

I hope this answers your question! If you need any clarifications,
please don't hesitate to ask. I would be more than happy to assist you
further.

Best Regards,
blader-ga

Clarification of Answer by blader-ga on 01 Jul 2002 00:24 PDT
Dear jonathanclark:

Upon rereading my answer, I realize that it may not be as clear as I
intended. What I meant to convey is that the msvcrt.lib is the same as
what you were looking for, the "msvcrt40.lib." The Microsoft naming
conventions for their libraries is why the name is "msvrt40.lib"
instead of the one you were looking for.

Google Search Strategy:

  msvcrt40.dll msvcrt.lib
  ://www.google.com/search?hl=en&ie=UTF-8&oe=UTF8&q=msvcrt40.dll+msvcrt.lib&btnG=Google+Search

Best Regards,
blader-ga

Request for Answer Clarification by jonathanclark-ga on 01 Jul 2002 01:30 PDT
Thanks, but you did not really answer my question.   I'm trying to
produce an EXE that links against msvcrt40.dll instead of msvcrt.dll. 
I have a copy of msvcrt.lib from Visual Studio, but linking with this
will cause the EXE to be bound to msvcrt.dll (and thus not load
properly under Windows 95).  It may be that I need a copy of
msvcrt.lib from Visual Studio 4.0 to accomplish this  but I would
confirmation before I try to track down a copy of VS 4.0.

I have previously found and read each of the link you presented, but
they do not provide the answer to my question.

Clarification of Answer by blader-ga on 01 Jul 2002 03:28 PDT
Dear jonathanclark:

Thank you for your clarification request. To help answer your
question, can you tell me the following:

Which version of Visual Studio are you using? Specifically, which
version of the msvcrt.lib?

Best Regards,
blader-ga

Request for Answer Clarification by jonathanclark-ga on 01 Jul 2002 04:04 PDT
I'm using Visual Studio 6.0 with Service pack 5.  There are no version
numbers for .lib files, that I'm aware of, but the file size of my
msvcrt.lib is 235,942.

I've also downloaded another version of msvcrt.lib size 550,422 and it
is linked with mscvrt.dll as well.  I used lib.exe to confirm this
both for my version of msvcrt.lib and the other copy I was able to
download.

Clarification of Answer by blader-ga on 01 Jul 2002 04:11 PDT
Also, when you mentioned "linking statically", did you mean link
implicitly (static load) or link explicitly (dynamic load)?

Clarification of Answer by blader-ga on 01 Jul 2002 04:27 PDT
Dear jonathanclark:

After conducting further research, I have concluded that the solution
is as you suspected in your request for clarification. Here is the
confirmation that you requested:

From the 1997 Corba Dev Archive:

 C Run-Time Library (without iostream) Characteristics Option
Defined

LIBC.LIB Single threaded, static link /ML
LIBCMT.LIB Multithreaded, static link /MT _MT
MSVCRT.LIB Multithreaded, dynamic link (import library for
MSVCRTx0.DLL) 1 /MD _MT, _DLL

1 In place of the "x" in the DLL name, substitute the major version
numeral of Visual C++ that you are using. For example, if you are
using Visual C++ version 4, then the library name would be
MSVCRT40.DLL.

Source: http://216.239.51.100/search?q=cache:8g-VSH42hKIC:lists.randomwalk.com/list-archive.qds.com/corba-dev-html.1997/0164.html+msvcrt40++%22import+library%22+OR+msvcrt.lib&hl=en&ie=UTF-8

So, it would seem from the above, the only way to actually link to
MSVCRT40.DLL implicitly (using a .lib file) is to acquire MSVCRT.LIB
from a VC++ 4.0 release. However, you can always link to any DLL you
like explicitly (which is referred by Microsoft as "dynamic load"),
but I suspect this is what you meant by "linking statically." This is
probably information you already knew, but just in case it helps, you
can find information on implicit versus explicity linking to DLLs
here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_core_link_an_executable_to_a_dll.asp

I also tried finding a version of MSVCRT.LIB online, but I was unable
to do so. I even found your newsgroup posting on June 28th asking for
it. =)

Please ask for a clarification if you have any additional concerns. I
am always here to help you further.

Best Regards,
blader-ga

Request for Answer Clarification by jonathanclark-ga on 01 Jul 2002 04:48 PDT
Ok, you are getting warmer, that at least confirms I can solve the
problem by using msvcrt.lib from VS 4.0 as I guessed. That's $4 worth
:)  But I still like to know where I can get Visual Studio 4.0, any
recommendations?  Since it's fairly old, it's not going to be in any
modern shops.  I tried looking for it on ebay, but no luck.  I also
tried a few file/ftp search engines as well as some file sharing
networks. Are there good places online to request this?  My purpose
behind all this, is I'm building an installer product that needs to be
as small as possible and also run on all windows platforms:

http://thinstall.com

Thanks!

Clarification of Answer by blader-ga on 01 Jul 2002 12:53 PDT
Dear jonathanclark:

I'd thought I'd never find it, but ... here it is! =) EMS Professional
Software is selling versions of VC++ 4.0 at the below webpage:

http://www.emsps.com/oldtools/mscppv.htm#vcpp4

I hope this helps. If you need any more clarifications, please let me
know.

Best Regards,
blader-ga
jonathanclark-ga rated this answer:4 out of 5 stars
great!

Comments  
There are no comments at this time.

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy