How to use OpenSSL with Visual Studio [closed] How to use OpenSSL with Visual Studio [closed] windows windows

How to use OpenSSL with Visual Studio [closed]


I know it's old! I faced the problem myself and here's the solution.

First of all, you should install (normal ordinary installation) openssl. (It's from here).

Now, after you create a project, I quote:

Make sure the following settings are setup in the project propertypages:

[C/C++ -> General -> Additional Include Directories] value:OpenSSL’s include directory in your machine (e.g C:\openssl\include)

[Linker -> General -> Additional Library Directories] value: OpenSSL’slib directory in your machine (e.g C:\openssl\lib)

[Linker -> Input-> Additional Dependencies] value: libeay32.lib

Source.


Add OpenSSL-related header files, and below headers:

#include <winsock2.h>#include <windows.h>

Open below Link & download pre-compiled files.

http://www.npcglib.org/~stathis/blog/precompiled-openssl/

extract and keep folder in C drive use readme_precompile.txt for instructions.

Open Visual C++ project and followup procedure given in below to include and Linker options.

Make sure the following settings are setup in the project property pages:

  • [C/C++ -> General -> Additional Include Directories]
    • OpenSSL’s include directory in your machine (e.g C:\openssl\include) or (e.g C:\openssl\include64)
  • [Linker -> General -> Additional Library Directories]
    • OpenSSL’s lib directory in your machine (e.g C:\openssl\lib) or (e.g C:\openssl\lib64)
  • [Linker -> Input -> Additional Dependencies]
    • ws2_32.lib
    • libsslMT.lib
    • Crypt32.lib
    • libcryptoMT.lib


Here are some resources: Compiling and installing OpenSSL for Windows, as well as Using OpenSSL for Cryptography (Blowfish, DES, RC2, RC4)

I have tried them myself yet I am still getting errors. OpenSSL and Visual Studio are not my forte, but maybe you can figure it out.