TedHopp has asked for the wisdom of the Perl Monks concerning the following question:

Using Strawberry Perl 5.8.9 on Windows XP Pro SP3, with the CPAN shell, I “install Crypt::OpenSSL::Random” and everything goes fine until:

CPAN.pm: Going to build I/IR/IROBERTS/Crypt-OpenSSL-Random-0.04.tar. +gz Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lssl Note (probably harmless): No library found for -lcrypto Writing Makefile for Crypt::OpenSSL::Random cp Random.pm blib\lib\Crypt\OpenSSL\Random.pm AutoSplitting blib\lib\Crypt\OpenSSL\Random.pm (blib\lib\auto\Crypt\Op +enSSL\Random) C:\strawberry\perl\bin\perl.exe C:\strawberry\perl\lib\ExtUtils\xsubpp + -typemap C:\strawberry\perl\lib\ExtUtils\typemap Random.xs > Rando +m.xsc && C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "mv" +-- Random.xsc Random.c Please specify prototyping behavior for Random.xs (see perlxs manual) gcc -c -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DUSE_SITECUSTOMIZE - +DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasing -DPER +L_MSVCRT_READFIX -s -O2 -DVERSION=\"0.04\" -DXS_VERSION=\"0 +.04\" "-IC:\strawberry\perl\lib\CORE" Random.c Running Mkbootstrap for Crypt::OpenSSL::Random () C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e "chmod" -- 644 +Random.bs C:\strawberry\perl\bin\perl.exe -MExtUtils::Mksymlists \ -e "Mksymlists('NAME'=>\"Crypt::OpenSSL::Random\", 'DLBASE' => 'R +andom', 'DL_FUNCS' => { }, 'FUNCLIST' => [], 'IMPORTS' => { }, 'DL_ +VARS' => []);" dlltool --def Random.def --output-exp dll.exp g++ -o blib\arch\auto\Crypt\OpenSSL\Random\Random.dll -Wl,--base-file +-Wl,dll.base -mdll -s -L"C:\strawberry\perl\lib\CORE" -L"C:\strawberr +y\c\lib" Random.o -Wl,--image-base,0x3d0c0000 C:\strawberry\perl\lib +\CORE\libperl58.a C:\strawberry\c\lib\libmsvcrt.a C:\strawberry\c\lib +\libmoldname.a C:\strawberry\c\lib\libkernel32.a C:\strawberry\c\lib\ +libuser32.a C:\strawberry\c\lib\libgdi32.a C:\strawberry\c\lib\libwin +spool.a C:\strawberry\c\lib\libcomdlg32.a C:\strawberry\c\lib\libadva +pi32.a C:\strawberry\c\lib\libshell32.a C:\strawberry\c\lib\libole32. +a C:\strawberry\c\lib\liboleaut32.a C:\strawberry\c\lib\libnetapi32.a + C:\strawberry\c\lib\libuuid.a C:\strawberry\c\lib\libws2_32.a C:\str +awberry\c\lib\libmpr.a C:\strawberry\c\lib\libwinmm.a C:\strawberry\c +\lib\libversion.a C:\strawberry\c\lib\libodbc32.a C:\strawberry\c\lib +\libodbccp32.a dll.exp Random.o:Random.c:(.text+0x141): undefined reference to `RAND_bytes' Random.o:Random.c:(.text+0x301): undefined reference to `RAND_bytes' Random.o:Random.c:(.text+0x4a6): undefined reference to `RAND_seed' Random.o:Random.c:(.text+0x4c7): undefined reference to `RAND_status' Random.o:Random.c:(.text+0x53c): undefined reference to `RAND_seed' Random.o:Random.c:(.text+0x622): undefined reference to `RAND_egd' Random.o:Random.c:(.text+0x6a9): undefined reference to `RAND_egd' Random.o:Random.c:(.text+0x770): undefined reference to `RAND_status' collect2: ld returned 1 exit status dmake.EXE: Error code 129, while making 'blib\arch\auto\Crypt\OpenSSL +\Random\Random.dll' IROBERTS/Crypt-OpenSSL-Random-0.04.tar.gz C:\strawberry\c\bin\dmake.EXE -- NOT OK

How do I fix this?

Replies are listed 'Best First'.
Re: Problem installing Crypt::OpenSSL::Random on Win32
by ahmad (Hermit) on Dec 31, 2009 at 05:38 UTC

    I do not actually use Strawberry Perl, but I think you have some missing library or at least not present in your "PATH"

    as it complains in the very first lines

    Note (probably harmless): No library found for -lssl Note (probably harmless): No library found for -lcrypto

    For me, I no longer believe the "probably harmless" message.

    if it's harmless why would the module author require its existence ?

    Try installing the missing libraries first and/or make sure both are present in your PATH ... then try re-installing the module.

Re: Problem installing Crypt::OpenSSL::Random on Win32
by syphilis (Archbishop) on Dec 31, 2009 at 08:27 UTC
    ahmad is quite right. I just wanted to add that the library that needs to be installed is "openssl". (It will give you *both* "-lssl" and "-lcrypto").

    Cheers,
    Rob
      Strawberry Perl ships with both ssl and crypto libraries, named libssl32.a and libcrypt32.a. I tried copying the libraries to, respectively, libssl.a and libcrypto.a. The warnings about missing libraries went away, but the complaints about the unresolved references didn't. The RAND_* functions appear in openssl/rand.h, which ships with Strawberry, so the functions should be in there somewhere, right? I'm wondering if this is a configuration problem either with Strawberry Perl (v. 5.8.9.3) or (much less likely, I assume) with the CPAN module.
        If you downloaded a win32 zip version of openssl (as opposed to installing mingw based version into C:\strawberry\c), you can use
        perl Makefile.PL "LIBS=-LC:\openssl\lib\MinGW -llibeay32 -lssleay32" " +INC=-IC:\openssl\include"