Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Crypt::OpenSSL::Random on Win32 with ActiveState

by rudds_perl_habit (Novice)
on Sep 08, 2014 at 23:33 UTC ( [id://1099916]=perlquestion: print w/replies, xml ) Need Help??

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

Using ActiveState Perl 5.14.2 (64bit)

Downloaded Crypt::OpenSSL::Random version 0.06

Installed OpenSSL 1.0.1i (prebuilt binaries, win64)

Define INCLUDE and LIB to have the OpenSSL in the path:

echo %LIB% C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\LIB\amd64;C:\Pr +ogram Files\Microsoft Visual Studio 9.0\VC\LIB\amd64;C:\Program Files +\Microsoft SDKs\Windows\v6.0A\lib\x64;C:\OpenSSL-Win64;C:\OpenSSL-Win +64\lib;C:\OpenSSL-Win64\bin echo %INCLUDE% C:\Program Files\Microsoft Visual Studio 9.0\VC\ATLMFC\INCLUDE;C:\Prog +ram Files\Microsoft Visual Studio 9.0\VC\INCLUDE;C:\Program Files\Mic +rosoft SDKs\Windows\v6.0A\include;C:\OpenSSL-Win64\include
first clue that something is wrong is:
perl Makefile.PL -lssl -lcrypto not found. Need to install the openssl devel packages. Checking if your kit is complete... Looks good Note (probably harmless): No library found for -lssl Note (probably harmless): No library found for -lcrypto Note (probably harmless): No library found for bufferoverflowU.lib Writing Makefile for Crypt::OpenSSL::Random Writing MYMETA.yml

Looking through the OpenSSL installation, I have ssleay32.lib and libssl32.dll and ssleay32.dll.

Trying to compile (nmake) gives the errors:
Random.obj : error LNK2001: unresolved external symbol RAND_status Random.obj : error LNK2001: unresolved external symbol RAND_egd Random.obj : error LNK2001: unresolved external symbol RAND_seed Random.obj : error LNK2001: unresolved external symbol RAND_bytes

Any help is greatly appreciated!

Replies are listed 'Best First'.
Re: Crypt::OpenSSL::Random on Win32 with ActiveState
by syphilis (Archbishop) on Sep 09, 2014 at 02:16 UTC
    Hi,
    Assuming ssleay32.lib is located in one of the directories specified in %LIB% (and assuming it can resolve the missing symbols), your only problem is that the Crypt::OpenSSL::Random Makefile.PL does not look for an import library named ssleay32.lib.
    Alternatively to the approach already suggested by Anonymous Monk, creating a copy of ssleay32.lib named ssl.lib (in any of the folders specified in %LIB%) should fix that.
    Or, in the Makefile.PL you could replace both occurrences of-lssl -lcrypto with -lssleay32 -lssl -lcrypto

    Cheers,
    Rob

      Thanks for the hints Rob and "Anonymous Monk". Using a combination of both, I was able to get it to work.

      I ended up doing:

      1. Install OpenSSL pre-built binaries for Win64
      2. In the OpenSSL Install directory:
      3. copy <ossldir>/libeay32.dll <ossldir>/ssl.dll copy <ossldir>/bin/libeay32.dll <ossldir>/bin/ssl.dll copy <ossldir>/lib/libeay32.lib <ossldir>/bin/ssl.lib
      4. In the Crypt-OpenSSL-Random-0.06 directory run:
      5. perl Makefile.PL LIBDIR="<ossldir>/lib" INCDIR="<ossldir>/include"
      6. ignore these messages, they seem bogus:
      7. -lssl -lcrypto not found. Need to install the openssl devel packages. 'INCDIR' is not a known MakeMaker parameter name. 'LIBDIR' is not a known MakeMaker parameter name.
      8. Build, test and install:
      9. nmake nmake test nmake install
Re: Crypt::OpenSSL::Random on Win32 with ActiveState
by Anonymous Monk on Sep 09, 2014 at 00:41 UTC

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1099916]
Approved by sundialsvc4
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-19 05:17 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found