cURL / Mailing Lists / curl-library / Single Mail

curl-library

Some questions regarding building libcurl with openssl

From: Tom Jerry <catod6_at_gmail.com>
Date: Mon, 13 Nov 2006 16:58:24 +0200

Hello,
I'm using libcurl 7.15.5 under Win32 and now I want to write a client
(multithreaded application) for accessing https web sites.
I've compiled the openssl library successfully, but only release version (I
still didn't figure how to build their debug version).
Now, I want to be able to create both debug and release versions of libcurl,
but I want it to be compiled with the /MT (or /MTd) option for the CRT.
1) Using the supplied Makefile (and Makefile.vc6), how do I control the
MD/MT flag? Should I edit it manually?

2) Do you encourage the use of makfile on windows (and therefore maintain
it) or that using the curllib.dsp is more recommended?

3) I really want to use the curllib.dsp (it is easier on windows). So I
added the USE_SSLEAY preprocessor definition (saw it in the mailing list)
and the appropriate include path and lib path to openssl libraries. It
compiles and links ok. Is the USE_SSLEAY flag all that I need?

4) The following is taken from openssl 0.9.8 FAQ:
"Note that debug and release libraries are NOT interchangeable. If you
built OpenSSL with /MD your application must use /MD and cannot use /MDd.
As per 0.9.8 the above limitation is eliminated for .DLLs. OpenSSL
.DLLs compiled with some specific run-time option [we insist on the
default /MD] can be deployed with application compiled with different
option or even different compiler. But there is a catch! Instead of
re-compiling OpenSSL toolkit, as you would have to with prior versions,
you have to compile small C snippet with compiler and/or options of
your choice. The snippet gets installed as
<install-root>/include/openssl/applink.c and should be either added to
your application project or simply #include-d in one [and only one]
of your application source files. Failure to link this shim module
into your application manifests itself as fatal "no OPENSSL_Applink"
run-time error. An explicit reminder is due that in this situation
[mixing compiler options] it is as important to add CRYPTO_malloc_init
prior first call to OpenSSL."

So does it influence the build process of libcurl? Should I include
applink.c in the libcurl.dsp in case I'm using /MD for building libcurl?

6) what about debug vs release builds? Can I build debug version of libcurl
using release version of openssl and run it?

Thank you,
Ori.
Received on 2006-11-13