curl-library
Re: Build Curl Library with Visual Studio 2005 *short version*;)
Date: Tue, 18 Apr 2006 12:08:48 +0200
Surfman19_at_gmx.at wrote:
> Hello,
> here my short tutorial to build curl-7.15.3 library with visual studio 2005!
>
> 1.) Build the curl-7.15.3 library:
> [...]
> 3.) Configurations for the Testcode Project:
> [...]
> LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in
> MSVCRTD.lib(MSVCR80D.dll)
> [...]
> 5.) Fixing this Problem:
> Change the Project Settings:
> -> Ignore Specific Library: libcmtd
>
Sorry Surfman, but this is not the right way to fix this problem.
The true source of the problem is that curl is compiled in "multithread
dll" mode, and that your Testcode Project stayed in the default
multithread non-dll mode. When compiling they try to use two different
versions of the C run-time, and that conflicts.
You should never mix code that has been compiled in one model with code
that has been compiled in another.
It may work for a while, but you're waiting for trouble to happen.
Why choose the "multithread dll" mode ? Because that's the best mode as
soon as you don't have a single module in your executable, that is as
soon as your program uses external dll.
So Step 5 should be :
Change the Project Settings:
-> In C/C++, code generation, Runtime library : Select Multi-thread DLL
(debug for your debug configuration)
Received on 2006-04-18