On Thu, 20 Oct 2005 13:30:14 +0400 "Victor B. Wagner" <[EMAIL PROTECTED]> wrote:
> On 2005.10.19 at 19:26:36 +0200, Steffen Pankratz wrote: > > > Hi > > > > I'm trying to get my dynamic engine to work on windows (openssl 0.9.8a, ms > > vc++ 7) > > it runs fine in linux > > Have you configured openssl with right way when building? > Check openssl include files you are using when compiling for definition > of OPENSSL_NO_DYNAMIC_ENGINE macro. It should be in opensslconf.h > If it is there, you have to run > > perl Configure VC-WIN32 shared > > and rebuild openssl as described in INSTALL.W32 You are right it's defined in opensslconf.h but also even if i add 'shared' to the Configure command. This is strange. Btw on Linux it's not even mentioned in opensslconf.h. > > > ----schnip------ > > > > #ifndef OPENSSL_NO_DYNAMIC_ENGINE > > static int bind_helper(ENGINE *e, const char *id) > > { > > if(id && (strcmp(id, engine_desecb_id) != 0)) > > return 0; > > if(!bind_desecb(e)) > > return 0; > > return 1; > > } > > > IMPLEMENT_DYNAMIC_CHECK_FN() > > IMPLEMENT_DYNAMIC_BIND_FN(bind_helper) > > Note that on Windows one have to add export declaration before both of > these macros. Otherwise functions, implemented by these macros wouldn't > be exported from DLL and openssl would be unable to load engine > dynamically. > > I have following code in my engine which loads successfully under Win32: > > #ifdef _WIN32 > extern __declspec( dllexport ) > #endif > > IMPLEMENT_DYNAMIC_BIND_FN(bind_gost); > #ifdef _WIN32 > extern __declspec( dllexport ) > #endif > IMPLEMENT_DYNAMIC_CHECK_FN(); > > Symbol _WIN32 is defined automagically by all Win32 compilers I've > tested (gcc/mingw32, gcc cross-compiler on Linix, various versions of > Borland, starting with 4.x, MSVC ) I thought as much but i had it in the wrong place. So i put it before the 2macros as you and it's working great now. > > so i tricked and did a #undef OPENSSL_NO_DYNAMIC_ENGINE > > but i can't load my dll in openssl at all Without this trick it's still doing the stuff in the else part. I have to figure out why OPENSSL_NO_DYNAMIC_ENGINE is defined in opensslconf.h. Thank you very much for your help, Victor. -- Hypnos powered by LFS SVN-20041206 (Linux 2.6.13.4) visit http://www.kratz00.org/ http://liflg.org/ Best regards, Steffen Pankratz. PGP PUBLIC KEY: http://www.kratz00.org/kratz00.at.gmx.de.asc ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager [EMAIL PROTECTED]