On Mon, Nov 07, 2005 at 05:37:59PM +0100, Julien ALLANOS wrote:
> Julien ALLANOS a écrit :
> >Hello,
> >
> >I have a Win32 application that uses OpenSSL 0.9.8a, libxml2, xmlsec, 
> >and other libraries. Thus I have to build them all using the same link 
> >configuration (/MD). However I want to be able to debug my application, 
> >and have both Release and Debug versions of every libraries in the same 
> >time on disk. Is there a way to build libeay32D.{lib|dll}, 
> >ssleay32D.{lib|dll} and opensslD.exe, using the current win32 build 
> >process?
> >
> >Thanks,
> 
> Actually, I have an application and a DLL. The DLL depends on the 
> previous libraries. And I just saw the applink.c tip in the FAQ. As I 
> don't really want to debug OpenSSL, but rather my application and my 
> DLL, I have included applink.c in my DLL project, compiled it in Debug 
> mode (/MDd) against a Release (/MD) libeay32, compiled the executable in 
> Debug mode and ran it. I get the "no OPENSSL_Applink" error again. Any 
> help please? Thanks.

You need to do some jiggery-pokery to get the Applink table to appear
properly named in the symbol table.

We had to declare it (using Borland) as;

extern "C"
{

  __declspec(dllexport) void** PASCAL OPENSSL_Applink(void)
  {
    ...
  }
}

The "extern C" stops name mangling happening, the "Pascal" stops an
underscore being prepended to the name. The "__declspec(dllexport)" is
needed to stop the linker going "hey, this isn't mentioned, I'll
remove it".

It's not mentioned otherwise because the Uplink system uses
"GetProcAddress" to provide runtime name resolution instead of a
compile-time dependency.

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to