curl-library
Re: libcurl static/static-'/MT' in MSVC, paying for binaries/.libs
Date: Fri, 15 Feb 2008 20:25:30 -0500
On Fri, Feb 15, 2008 at 6:18 AM, Georg Lippitsch <georg.lippitsch_at_gmx.at>
wrote:
> Am Donnerstag, 14. Februar 2008 23:30 schrieb Daniel Stenberg:
> > On Thu, 14 Feb 2008, Georg Lippitsch wrote:
> > > BTW, it's really confusing that curl sets /MT in \lib\Makefile.VC*
> > > automatically when RTLIBCFG ist set to static, but does not in
> > > \src\Makefile.VC*
> >
> > Please submit a patch if you have a fix!
>
> OK, only copied the stuff from /lib/Makefile.vc6 to /src/Makefile.vc6:
>
> Index: Makefile.vc6
> ===================================================================
> RCS file: /cvsroot/curl/curl/src/Makefile.vc6,v
> retrieving revision 1.39
> diff -u -r1.39 Makefile.vc6
> --- Makefile.vc6 23 Jan 2008 07:27:40 -0000 1.39
> +++ Makefile.vc6 15 Feb 2008 11:14:11 -0000
> @@ -61,13 +61,22 @@
> SSL_IMP_LFLAGS = /LIBPATH:"$(OPENSSL_PATH)/out32dll"
> SSL_LIBS = libeay32.lib ssleay32.lib gdi32.lib user32.lib
> advapi32.lib
>
> +# Runtime library configuration
> +RTLIB = /MD
> +RTLIBD = /MDd
> +
> +!IF "$(RTLIBCFG)" == "static"
> +RTLIB = /MT
> +RTLIBD = /MTd
> +!ENDIF
> +
> ## Release
> -CCR = cl.exe /MD /O2 /DNDEBUG
> +CCR = cl.exe $(RTLIB) /O2 /DNDEBUG
> LINKR = link.exe /incremental:no /libpath:"../lib"
> RCR = rc.exe /dCURLDEBUG=0
>
> ## Debug
> -CCD = cl.exe /MDd /Gm /ZI /Od /D_DEBUG /GZ
> +CCD = cl.exe $(RTLIBD) /Gm /ZI /Od /D_DEBUG /GZ
> LINKD = link.exe /incremental:yes /debug /libpath:"../lib"
> RCD = rc.exe /dCURLDEBUG=1
>
>
Georg,
Thanks for this. I can now successfully compile an /MT version of libcurl.
For those who are interested, switching my project to /MT and replacing the
/MD versions of libcurl/ssleay/libeay with /MT ones causes the program to
almost compile. See the error output below. Adding MSVCRT.LIB to the IGNORE
SPECIFIC LIBRARY list causes the program to compile and run successfully.
Whether this is overriding some important failsafe and is a disaster waiting
to happen, I don't know.
1>Searching libraries
1> Searching ssleay32.lib:
1> Searching libeay32.lib:
1> Searching libcurl.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\ws2_32.lib:
1> Searching ..\..\BaseClasses\Release\\Strmbase.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\winmm.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\Msacm32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\WSOCK32.LIB:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\kernel32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\user32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\gdi32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\winspool.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\comdlg32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\advapi32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\shell32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\ole32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\oleaut32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\odbc32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\odbccp32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\LIBCMT.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\MSVCRT.lib:
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: __thiscall
type_info::type_info(class type_info const &)" (??0type_info@@AAE_at_ABV0@@Z)
already defined in LIBCMT.lib(typinfo.obj)
1>MSVCRT.lib(ti_inst.obj) : error LNK2005: "private: class type_info &
__thiscall type_info::operator=(class type_info const &)" (??4type_info@@
AAEAAV0_at_ABV0@@Z) already defined in LIBCMT.lib(typinfo.obj)
1> Searching ssleay32.lib:
1> Searching libeay32.lib:
1> Searching libcurl.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\ws2_32.lib:
1> Searching ..\..\BaseClasses\Release\\Strmbase.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\winmm.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\Msacm32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\WSOCK32.LIB:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\kernel32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\user32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\gdi32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\winspool.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\comdlg32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\advapi32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\shell32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\ole32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\oleaut32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\odbc32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\odbccp32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\LIBCMT.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\OLDNAMES.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\MSVCRT.lib:
1> Searching ssleay32.lib:
1> Searching libeay32.lib:
1> Searching libcurl.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\ws2_32.lib:
1> Searching ..\..\BaseClasses\Release\\Strmbase.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\winmm.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\Msacm32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\WSOCK32.LIB:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\kernel32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\user32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\gdi32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\winspool.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\comdlg32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\advapi32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\shell32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\ole32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\oleaut32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio 8\VC\lib\uuid.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\odbc32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\PlatformSDK\lib\odbccp32.lib:
1> Searching C:\Program Files\Microsoft Visual Studio
8\VC\lib\LIBCMT.lib:
1>Finished searching libraries
1>LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other
libs; use /NODEFAULTLIB:library
1>Release\program.exe : fatal error LNK1169: one or more multiply defined
symbols found
Received on 2008-02-16