Sergio Gallego Sacristana Martinez wrote:
> MSVCRT.lib(MSVCRT.dll) : error LNK2005: [function] already defined in
> LIBCD.lib(sprintf.obj)
> 
> Could somebody help me??

Here's my two cents worth, anyway.

The linker is complaining because it's finding two copies of the C
runtime library.

MSVCRT.lib is the standard C, dynamic link, release mode version;
LIBCD.lib is the standard C, static link, single-threaded, debug mode
version.

I think this kind of message appears when you are trying to link the
default 'static library' OpenSSL builds, which default to linking
against MSVCRT.lib, to a generic VC6 project, which defaults to linking
against LIBCD.lib.

A quick and dirty solution is to change your application type to
"Multithreaded DLL" (release or debug as applicable) under the code
generation tab in your project settings.

A better solution is to replace the '/MD' flag in your OpenSSL static
library makefile with '/MT', which would cause it to link OpenSSL with
LIBCMT.lib, making it independent of the MSVCRT shared object. You would
then also need to update your application linkage to reflect this.

Regards,

//oscar

S/MIME Cryptographic Signature

Reply via email to