Using OpenSSL in Visual Studio 2012

I downloaded the latest version of Openssl from http://www.openssl.org/source/

I would like to use it in Visual Studio 2012, especially getting the hash file md5 / sha-1, but I cannot enable / configure the environment using the openssl library. Honestly, I got confused what to include, and where, however, I read README.

I get this error.

Error 1 error LNK2019: unresolved external symbol _MD5_Init referenced in function _main 

So my question is: I downloaded the latest version (openssl-1.0.1e.tar.gz), what do I need to configure in VS2012 in order to be able to use lib? Thanks!

UPDATE

This question helped me find a solution. Enhance SSL with Visual Studio 2010 and OpenSSL

The steps required to use openSSL lib with VS2012:

  • download and install the version (I have a 64-bit OS, but I installed 32-bit openssl) from http://slproweb.com/products/Win32OpenSSL.html .
  • A new project in VS, then Configuration Properties / C / C ++ / General / Additional Directories Include: openssl include folder (C: \ OpenSSL-Win32 \ include)
  • Linker / General / Additional Directions Libraries: C: \ OpenSSL-Win32 \ lib
  • Linker / Input / Additional Dependencies:
libeay32MD.lib ssleay32.lib ssleay32MTd.lib ssleay32MT.lib ssleay32MDd.lib ssleay32MD.lib

(It was written that I only need to add one that matches the C / C ++ / Code Generation / Runtime Library, but it works just that.)

  • Copy those files to the current VS / VC / lib folder
+6
source share
1 answer

Which compiler did you use to compile OpenSSL? Have you used MinGW? If so, make sure that you do not separate them (or simply using --strip-unneeded), otherwise the import characters will be deleted. Are lib headers and versions consistent?

Perhaps you want to try the pre-built ones: http://slproweb.com/products/Win32OpenSSL.html , which work exactly.

+5
source

Source: https://habr.com/ru/post/947377/


All Articles