cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: libcurl static/static-'/MT' in MSVC, paying for binaries/.libs

From: Kevin Lawler <kevin.lawler_at_gmail.com>
Date: Thu, 14 Feb 2008 12:51:47 -0500

On Thu, Feb 14, 2008 at 12:24 PM, Yang Tse <yangsita_at_gmail.com> wrote:

> I have to correct myself part of what I've said above...
>
> > Remember that with /MT you will get the c runtime library statically
> > linked into _each_ built library. So if your program uses more than
> > one library you would end up with an app that has more than one copy
> > of the CRT, with the additional surprise that they don't share
> > internal status data.
>
> The paragraph above is only true if you were building a dll with /MT.
>
> > I suggest you that you use /MD to build each library and app even if
> > you finally link them statically.
>
> I still suggest this as a starting point.
>
> And remember that BUILDING_LIBCURL must be defined when
> building/compiling libcurl library and undefined when
> building/compiling/linking main app.
>
> --
> -=[Yang]=-
>

Yang,

(I am not building a DLL.)

I have a working application that relies on all /MD libraries (including
libcurl and the ssh libraries). If I only had an /MT libcurl (static, i.e.
no libcurl.dll, and with SSH and CURL_LDAP_DISABLED) I believe I could have
an application that was all /MT.

My motivation for this that we recently had our application fail to run on a
client's machine, and my guess is a missing or improper DLL. Obviously my
knowledge is shaky on this matter. It is my understanding that switching to
/MT from /MD might eliminate this problem. Certainly it would remove a
dependency, and that's something we always like. Our application is still
very lightweight.

What do you think?

Kevin
Received on 2008-02-14